Days counting in (date and time) field

G

Guest

All Access users,
Good Day,

I have a problem and looking solution.

DateDiff("d",[ParkingDatetime],[DriveOutDateTime])=day/days
I would like see day only if crossed 23.59 other wise response should be zoo.

Regards,



--
Access Keen User


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...7b03&dg=microsoft.public.access.modulesdaovba
 
A

Allen Browne

You want the records where the ParkingDatetime field is a different date
than the DateOutDateTime?

Try:
DateValue([DateOutDateTime]) - DateValue([ParkingDatetime])


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
A

Alex Dybenko

hi,
you can also get a difference in minutes for more accurate result
DateDiff("n",[ParkingDatetime],[DriveOutDateTime])
 
T

Tim Ferguson

I would like see day only if crossed 23.59 other wise response should
be zoo.

hi,
you can also get a difference in minutes for more accurate result
DateDiff("n",[ParkingDatetime],[DriveOutDateTime])

AIUI, he actually wants the exact opposite of this...

Tuesday 23:58 to Wednesday 00:02 = 4 minutes but 1 day

Tuesday 00:02 to Tuesday 23:58 = 1436 minutes but 0 days.


I think the DateValue(b) - DateValue(a) is the way to go.

All the best


Tim F
 

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