I need help with a calculated time query.

MAC_Addy

New member
Local time
Today, 11:22
Joined
Sep 23, 2013
Messages
2
HI there.

I've been trying to rack my brains about this query, but I just can't get it to work.

To give a description I have a database that users input to. From there I need two boxes to auto-generate some information. The information I need it to pull is from multiple fields within a table. Those fields are: Assign time, unload time, total, and expected time.

Basically this describes if we're over or under on a specific job. If it's under, it'll auto-populate same with if it's over.

Please see below on my code, and please feel free to change what's in there. This is for the "under time" auto generated field. I cannot get it to work..

Over Time: IIf([loadtime].[AssignTime]>[unloadTime]
([loadtime].[EstimatedTime] +23,<,[TotalTime] - [EstimatedTime]-23) IIf([loadtime]. [TotalTime] > [EstimatedTime], [TotalTime]-[EstimatedTime],)
 
If you are trying to add to a date you should use the DateAdd() function.

Code:
... DateAdd("h",23,[loadtime].[EstimatedTime]) ...
This will add 23 hours to the value stored in [loadtime].[EstimatedTime].

If you are trying to determine time between 2 dates use the DateDiff() function.

Code:
... DateDiff("h",#09/23/2013 11 AM#,#09/23/2013 4 PM#) ...
This will determine how many hours difference between the 2 times.

You can find complete examples in the help or by googling.
 

Users who are viewing this thread

Back
Top Bottom