Error in query

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

Guest

Hello,
i have a table that contains: username,date,timein,timeout.
everday a new record will be inserted.
at the end of the month, the system should generate a monthly report that
contains : month name, username,date,timein,timout. also the report should
calculate the working working per this month.
i'm really confused about how to make this report, also the user should pick
a name from a list, and the report will be generated acording to this name,
so how can i send this name to the report ...

i wrote this sql but it doesn't work ... so plz help help

SELECT emp.ename, data.t1in, data.edate, data.t1out, data.t2in, data.t2out,
emp.eid FROM emp INNER JOIN data ON emp.eid=data.eid WHERE ((edate=dd) And
((emp.eid)= " & reportname & "));

thanks in advance
Sensay.
 
Hi.
Try the following SQL:
SELECT emp.ename, data.t1In, data.edate, data.t1Out, data.t2In, data.t2Out,
emp.eid, Format([edate],"mm") AS [Month], Format([t1Out]-[t1In],"Short Time")
AS Time1, Format([t2Out]-[t2In],"Short Time") AS Time2,
([t1Out]-[t1In])+([t2Out]-[t2In]) AS TimeTotal
FROM emp INNER JOIN data ON emp.eid = data.EID
WHERE (((Format([edate],"mm"))=[Enter Month, like 01,02, etc]));
You will note I did the calculation in the Query rather than the report,
Hope this helps.
Fons
 
Back
Top