Query and time

  • Thread starter Gaetanm via AccessMonster.com
  • Start date
G

Gaetanm via AccessMonster.com

I have a form that has a text field that the total work hours for this week
will be put in by a Dlookup Controll source of the text box.
I'm having a problem with the query I need the query to give me the
total minutes from [ToTalHoursMinutes] then calculate that into
hours and minutes (hh.nn) so that my Dlookup can get that info
and stick it into the txt field of my form and still keeping the EmployeeID
value from a combo box as the criteria.

this what I have so far

SELECT Clock_Table.EmployeeID, Clock_Table.StartDate, Clock_Table.StopDate,
DateDiff("n",[Startdate],[Stopdate])\60 & Format(DateDiff("n",[Startdate],
[Stopdate]) Mod 60,"\:00") AS ToTalTime, DateDiff("n",[Startdate],[Stopdate])
AS TotalHoursMinutes, Round([TotalHoursMinutes]/60,2) AS HundredTime
FROM Clock_Table
WHERE (((Clock_Table.EmployeeID)=[Forms]![frmClock_Start_Table]!
[cboEmployeeId]) AND ((Clock_Table.StopDate)>Date()-Weekday(Date()+1)));

EmployeeID StartDate StopDate ToTalTime TotalHoursMinutes HundredTime
2 11/10/2006 2:31:04 PM 11/10/2006 4:49:19 PM 2:18 138 2.3
2 11/13/2006 8:28:53 AM 11/13/2006 8:43:45 AM 0:15 15 0.25
2 11/13/2006 8:43:23 AM 11/13/2006 8:43:45 AM 0:00 0 0
2 11/13/2006 9:44:31 AM 11/13/2006 9:53:45 AM 0:09 9 0.15
2 11/13/2006 9:47:30 AM 11/13/2006 9:53:45 AM 0:06 6 0.1
2 11/13/2006 9:48:44 AM 11/13/2006 10:43:45 AM 0:55 55 0.92
2 11/13/2006 10:22:32 AM 11/13/2006 10:43:45 AM0:21 21 0.35

Do I have to generate another query if so how would that look like?

Gaetanm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top