Does this mean you have solved your problem?
First Day of Current Quarter
DateSerial(Year(Date()),((DatePart("q",Date())-1)*3)+1,1)
Last Day of Current Quarter
DateSerial(Year(Date()),((DatePart("q",Date())-1)*3)+4,0)
First Day of Prior Quarter
DateSerial(Year(Date()),((DatePart("q",Date())-1)*3)+1-3,1)
Last Day of Prior Quarter
DateSerial(Year(Date()),((DatePart("q",Date())-1)*3)+4-1,0)
If you want data for just the current quarter of the current year then
you
might use the following SQL
SELECT tblMain.[EMPLOYEE NAME], Sum([DT REGULAR])/(Sum([EMPLOYEE
TIME]-[DT
Reason 1]-[DT MAINTENANCE]-[DT Reason 2])) AS [Delay Percent]
FROM tblEmployees INNER JOIN tblMain ON tblEmployees.EmployeeName =
tblMain.[EMPLOYEE NAME]
WHERE tblMain.[DAYS DATE] Between
DateSerial(Year(Date()),((DatePart("q",Date())-1)*3)+1,1)
and DateSerial(Year(Date()),((DatePart("q",Date())-1)*3)+4,0)
AND tblEmployees.Status=False
GROUP BY tblMain.ID, tblMain.[DAYS DATE]
, tblMain.[EMPLOYEE NAME]
, DatePart("q",[DAYS DATE]), tblEmployees.Status
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
Chad said:
I figured out how to get what dates were in what quarter by my quarter
expression. I want an Daily percent for an employee in the current
quarter.
Hope this helps...
SELECT tblMain.[EMPLOYEE NAME], Sum([DT REGULAR])/(Sum([EMPLOYEE
TIME]-[DT
Reason 1]-[DT MAINTENANCE]-[DT Reason 2])) AS [Delay Percent]
FROM tblEmployees INNER JOIN tblMain ON tblEmployees.EmployeeName =
tblMain.[EMPLOYEE NAME]
GROUP BY tblMain.ID, tblMain.[DAYS DATE], tblMain.[EMPLOYEE NAME],
DatePart("q",[DAYS DATE]), tblEmployees.Status
HAVING (((tblEmployees.Status)=False));
--
Newbies need extra loven.........
:
Hello, I want to run a query that would give me a total for the
current
quarter for the year instead of puting in a date range. I have a
formula
[expression] in my query that I want this for. Please help!
Here is my expression:
Delay Percent: Sum([DT REGULAR])/(Sum([EMPLOYEE TIME]-[DT Reason
1]-[DT
MAINTENANCE]-[DT Reason 2]))