Mike Hughes
Registered User.
- Local time
- Today, 12:06
- Joined
- Mar 23, 2002
- Messages
- 493
I'm building this for my wife and she keeps changing what she needs.........so........
SELECT tblAPPLICATIONS.SPECIALIST, tblAPPLICATIONS.REPORTS, Avg(DateDiff("d",[DATE RECEIVED],[DATE OF DECISION])) AS DAYS, DateAdd("yyyy",-1,Date())+1 & " - " & Date() AS [REPORT PERIOD], Format(Int([Days]/365),"00-") & Format(Int((([Days] Mod 365)/30)),"00-") & Format(([Days]-(Int([Days]/365)*365+Int(([Days] Mod 365)/30))*30),"00") AS MyDays
FROM tblAPPLICATIONS
WHERE (((tblAPPLICATIONS.[DATE OF DECISION])>=DateAdd("yyyy",-1,Date())+1))
GROUP BY tblAPPLICATIONS.SPECIALIST, tblAPPLICATIONS.REPORTS;
If I run this query today the REPORT PERIOD would come back as
03/13/2002 - 03/12/2003
I would like to have the query changed to return the REPORT PERIOD if I ran it today
of 04/01/2002 – 03/31/2003.
In other words,
The first date should be the FIRST DAY of the Month, of the Month that follows the Month the report is run, less 1 year, 04/01/2002.
The second date should be the LAST DAY of the Month in which the report is run. 03/31/2003.
Can someone tell me if this can be done and if it can would you please give an example of what the query would be.
Thanks
SELECT tblAPPLICATIONS.SPECIALIST, tblAPPLICATIONS.REPORTS, Avg(DateDiff("d",[DATE RECEIVED],[DATE OF DECISION])) AS DAYS, DateAdd("yyyy",-1,Date())+1 & " - " & Date() AS [REPORT PERIOD], Format(Int([Days]/365),"00-") & Format(Int((([Days] Mod 365)/30)),"00-") & Format(([Days]-(Int([Days]/365)*365+Int(([Days] Mod 365)/30))*30),"00") AS MyDays
FROM tblAPPLICATIONS
WHERE (((tblAPPLICATIONS.[DATE OF DECISION])>=DateAdd("yyyy",-1,Date())+1))
GROUP BY tblAPPLICATIONS.SPECIALIST, tblAPPLICATIONS.REPORTS;
If I run this query today the REPORT PERIOD would come back as
03/13/2002 - 03/12/2003
I would like to have the query changed to return the REPORT PERIOD if I ran it today
of 04/01/2002 – 03/31/2003.
In other words,
The first date should be the FIRST DAY of the Month, of the Month that follows the Month the report is run, less 1 year, 04/01/2002.
The second date should be the LAST DAY of the Month in which the report is run. 03/31/2003.
Can someone tell me if this can be done and if it can would you please give an example of what the query would be.
Thanks