Re: Difference in days from multiple records
From: Bill Taylor (wtaylor51537_at_earthlink.net)
Date: 04/29/04
- Next message: Duane Hookom: "Re: Switch is overloaded!"
- Previous message: Gary Walter: "Re: help with delete query"
- In reply to: Fredrick Smith: "Difference in days from multiple records"
- Next in thread: Fredrick: "Re: Difference in days from multiple records"
- Reply: Fredrick: "Re: Difference in days from multiple records"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 19:47:47 GMT
You will need a date the case is returned. from this date you can us
Rdate(field name for date returned) - ADate( assigned date). this will
return the number of days.
HTH
"Fredrick Smith" <anonymous@discussions.microsoft.com> wrote in message
news:D6864FF3-CF26-4A52-8467-442D8270547F@microsoft.com...
> I am trying to write a enhance one of my queries. My Boss needs a report
that will show the amount of days each employee had a case. So I wrote a
query to show all the employees, the actions and the dates for each:
>
> SELECT To.LastName AS [Assigned TO], A.ActDoneDate FROM tbl_AdminUsers AS
[by] INNER JOIN (tbl_AdminUsers AS [To] INNER JOIN tblCaseActivities AS A ON
To.UserID = A.AssignedTO) ON by.UserID = A.AssignedBY
> WHERE (((A.ActDone)=1) AND ((A.CaseID)=[Forms]![frmCaseDetail]![CaseID]))
> ORDER BY A.ActDoneDate DESC;
>
> Which produces thos output:
>
> Assigned TO ActDoneDate
> Howard 3/9/2004
> Crawford 3/9/2004
> Smith 3/9/2004
> Paramore 3/2/2004
> Howard 3/1/2004
> Aliyy 2/9/2004
> Moultrie 10/17/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/13/2003
> Walker 10/1/2003
> Walker 6/29/2003
> Walker 3/11/2003
> Walker 2/5/2003
> Walker 2/5/2003
> Walker 2/4/2003
> Walker 2/4/2003
> Walker 2/4/2003
> Walker 1/30/2003
> Walker 9/16/2002
> Green 2/27/2002
> Crum 2/12/2002
> Crum 2/11/2002
> Crum 2/6/2002
> Crum 2/5/2002
> Crum 2/5/2002
> Crum 2/5/2002
> Crum 2/5/2002
> Green 1/11/2002
> Dessommes 12/31/2001
> Dessommes 12/28/2001
> Dessommes 12/18/2001
> Gordy 11/8/2001
> Moultrie 11/6/2001
>
> I would like to filter out a few all of the first duplicates and Ex.
(Dessommes will only show the last record) and would also like another
column with the amount of days between the previous record as below:
>
> Assigned TO ActDoneDate Days
> Howard 3/9/2004 0
> Crawford 3/9/2004 0
> Smith 3/9/2004 7
> Paramore 3/2/2004 1
> Howard 3/1/2004 21
> Aliyy 2/9/2004 115
> Moultrie 10/17/2003 396
> Walker 9/16/2002 201
> Green 2/27/2002 22
> Crum 2/5/2002 25
> Green 1/11/2002 24
> Dessommes 12/18/2001 40
> Gordy 11/8/2001 2
> Moultrie 11/6/2001
>
> Can anyone help out with this?
- Next message: Duane Hookom: "Re: Switch is overloaded!"
- Previous message: Gary Walter: "Re: help with delete query"
- In reply to: Fredrick Smith: "Difference in days from multiple records"
- Next in thread: Fredrick: "Re: Difference in days from multiple records"
- Reply: Fredrick: "Re: Difference in days from multiple records"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|