Em Andamento

SQL Query to calculate duration between specific database events

We need a SQL Query to calculate the duration (in days)? between specific events in a SQL database. There is no code or application development needed, only a SQL query.

## Deliverables

We need a SQL query that can calculate the difference in days between? specific events in? a SQL database. For example, we have a database with a table called "EVENTS" with the following data:

**EventDate? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? EventType? ? ? ? ? ? ? ? ? ? ? ? EventUser**

2008-07-01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ENABLED? ? ? ? ? ? ? ? ? ? ? ? ? ? USERID1

2008-07-02? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ENABLED? ? ? ? ? ? ? ? ? ? ? ? ? ? USERID2

2008-07-03? ? ? ? ? ? ? ? ? ? ? ? ? ? ENABLED? ? ? ? ? ? ? ? ? ? ? ? ? ? ? USERID3

2008-07-05? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DISABLED? ? ? ? ? ? ? ? ? ? ? ? ? USERID3

2008-07-07? ? ? ? ? ? ? ? ? ? ? ? ? ? DISABLED? ? ? ? ? ? ? ? ? ? ? ? ? USERID1

2008-07-10? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DISABLED? ? ? ? ? ? ? ? ? ? ? ? ? USERID2

? ? ? ? ? ? ? ? ? ? ?

The SQL query should calculate the difference (in days) between each EventUser's ENABLED and DISABLED state, and place it into column in the result set, which I have named "TotalDaysInEnabledState" as an example. Here is what the result set should look like.

**EventUser? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TotalDaysInEnabledState

**USERID2? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 8

USERID1? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 6

USERID3? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2

The result set should be sorted in descending order by the "TotalDaysInEnabledState" result column.

This will need to be done using standard ANSI SQL, without any special database extensions, stored procedures, or views used.

Habilidades: Administração de Bancos de Dados, Engenharia, Microsoft Access, MySQL, Oracle, PHP, Gestão de projetos, Arquitetura de software, Teste de Software, SQL, Visual Foxpro

Ver mais: sql query calculate duration, sql query duration, sorted data set, named query, what is database management, sql views, SQL Query, query table, data query, project using sql, application calculate, query query, query project data, SQL stored, code ansi code, database query project, project ansi, query project database, php project sql database, events database, project sql query, application development database, project query, sql query project, events management

Acerca do Empregador:
( 38 comentários ) Plano, United States

ID do Projeto: #3065962

Premiar a:

iLoveCoding

See private message.

$5 USD em 14 dias
(74 Avaliações)
5.2

36 freelancers estão ofertando em média $27 para este trabalho

hits

See private message.

$17 USD in 14 dias
(863 Comentários)
8.8
javaoraclepro

See private message.

$85 USD in 14 dias
(166 Comentários)
7.5
oneclickdevelop

See private message.

$42.5 USD in 14 dias
(105 Comentários)
6.5
agrasth

See private message.

$25.5 USD in 14 dias
(107 Comentários)
6.2
zosoft

See private message.

$85 USD in 14 dias
(74 Comentários)
6.2
suryavijayvw

See private message.

$24.65 USD in 14 dias
(117 Comentários)
5.6
tusharjohri

See private message.

$16.15 USD in 14 dias
(82 Comentários)
5.6
IVasilev

See private message.

$42.5 USD in 14 dias
(51 Comentários)
5.5
sergruch

See private message.

$8.5 USD in 14 dias
(85 Comentários)
5.4
spyoo

See private message.

$21.25 USD in 14 dias
(45 Comentários)
5.3
heisenbug

See private message.

$25.5 USD in 14 dias
(16 Comentários)
5.0
seventhsensesl

See private message.

$6.8 USD in 14 dias
(67 Comentários)
4.9
geniussoftwvw

See private message.

$42.5 USD in 14 dias
(20 Comentários)
4.8
spx2vw

See private message.

$51 USD in 14 dias
(38 Comentários)
4.7
jrsansom

See private message.

$6.79 USD in 14 dias
(23 Comentários)
4.5
fsoikin

See private message.

$34 USD in 14 dias
(5 Comentários)
4.4
teamloweu

See private message.

$34 USD in 14 dias
(15 Comentários)
4.3
eradaec

See private message.

$8.5 USD in 14 dias
(18 Comentários)
4.1
syedtariqvw

See private message.

$6.8 USD in 14 dias
(16 Comentários)
4.0
zincksoft

See private message.

$17 USD in 14 dias
(27 Comentários)
4.0