How to convert a datetime field do a date field

Gkirkup

Registered User.
Local time
Today, 08:03
Joined
Mar 6, 2007
Messages
628
I am trying to deduct a datetime field from a date field to decide how many days are in between. It doesn't let me. So do I need to convert the datetime field to a date field first? How would I do that?
Or is there a function I can use to calculate the date difference?

Robert
 
Take a look at the DateDiff() function as documented in the Access help file. I think that may be what you require.
 
We discussed this in your other post. Use the DateValue() function to extract only the date part. DateDiff() is also an option.

Functions are your friend and VBA has many of them. Search help for a function list. Choose the one grouped by type rather than alpha. The alpha list requires you to know the name of the function whereas, the type grouping lets you search through a much smaller list if you are looking for a "financial" function or a "date" function. It isn't necessary to memorize the list but do become familiar with it so you have a feel for what is available and don't have to keep reinventing the wheel.
 

Users who are viewing this thread

Back
Top Bottom