SQL Selection Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to Enter A Certain Month And Display the Sum Of the Fields For
That Month? Is there any error for my SQL below? I don't seem to be able to
get a result.

SELECT TimeCard.DriverID, Sum(TimeCard.OT_HRS) AS SumOfOT_HRS,
Sum(TimeCard.LATE_HRS) AS SumOfLATE_HRS
FROM TimeCard
WHERE (((DatePart("nn",[DateEntered]))=[Enter Month]))
GROUP BY TimeCard.DriverID;
 
Seikyo said:
Is it possible to Enter A Certain Month And Display the Sum Of the Fields For
That Month? Is there any error for my SQL below? I don't seem to be able to
get a result.

SELECT TimeCard.DriverID, Sum(TimeCard.OT_HRS) AS SumOfOT_HRS,
Sum(TimeCard.LATE_HRS) AS SumOfLATE_HRS
FROM TimeCard
WHERE (((DatePart("nn",[DateEntered]))=[Enter Month]))
GROUP BY TimeCard.DriverID;

Should be DatePart("m", DateEntered)

"m" = month
"nn" = 2-digit minutes
 
Back
Top