Date "string" as parameter!

Paul Clark

Registered User.
Local time
Today, 11:33
Joined
Oct 30, 2011
Messages
23
I am trying to set a criteria field to look for >#01/09/[current year]# but every combination of Date() returns invalid value.
Any clues?
 
Welcome to the Forum.

You are going to need to use the DatePart() and DateSerial() functions. Your criteria will look something like;
Code:
># DateSerial(DatePart(Date(),"yyyy"),9,1) #
 
The actual format of code the did the job was:
DateSerial(DatePart("yyyy",Date()),9,1)

Excellent
 
I would have gone with YEAR instead of DatePart:

DateSerial(Year(Date()),9,1)

that is even less typing :D
 

Users who are viewing this thread

Back
Top Bottom