Date() Function for Audit Field

Pisteuo

Registered User.
Local time
Today, 01:28
Joined
Jul 12, 2009
Messages
72
I am attempting to add an audit field that rounds to the nearest month. Arguments for the Date() function appear to be non-existent.

Excel Date() function requires three arguments - year, month, day. When I try to use these arguments in a field's Default Value expression builder, I receive the following message: "The expression you entered has a function containing the wrong number of arguments".

Here is the formula I am trying to use:

Code:
=IIf(Day(Now())>=1 And Day(Now())<=15, DATE(YEAR(NOW()),MONTH(NOW()),1), DATE(YEAR(NOW()),MONTH(NOW())+1,1))

Here is the working excel formula:

Code:
=IF(DAY(NOW())>=1 AND DAY(NOW())<=15,
DATE(YEAR(NOW()),MONTH(NOW()),1),
DATE(YEAR(NOW()),MONTH(NOW())+1,1))

Thank you for the help.
 
Try looking into the documentation -that's always a good start.
 
I read Access' help documentation about the Date Function before posting my question, and googled syntax for the function.

Documentation that I found does not specify arguments for the Date Function.

Do you have any suggestions? Thank you.
 
Thank you. To follow up on the thread: DateSerial for Access works the same as Date for Excel.
 

Users who are viewing this thread

Back
Top Bottom