View Full Version : */*/&[What year do you want?]


Gordon
02-15-2005, 10:49 AM
I'm trying to set up a parameter for a query which would allow the end user to type in a year, and have it show all occurances for the year.

I've tried the following syntax, which does not work.....

Like "*/*/&[what is year?]

Any suggestions for the correct syntax on this?

Thanks!


Gordon

Pat Hartman
02-15-2005, 11:20 AM
Like works with strings. Despite what your eyes tell you, a date is not a string. Dates are stored as double precision numbers with the integer portion representing the number of days since Dec 30, 1899 and the decimal portion represents the time of day.

If you want to extract a part of a date, use either the DatePart() function or the specific Year(), Month(), Day() functions.

Gordon
02-15-2005, 01:27 PM
Thanks - I ended up using the syntax DATEYEAR: DatePart("yyyy",[Date]) and putting the parameter [What Year do you want?] in the criteria. This worked.

Gordon