how to get year and month value from date field

spec

Registered User.
Local time
, 17:30
Joined
Jun 9, 2005
Messages
12
hi friends,

I want to get year and month field of datetime field so that i can get data by comparing them with other table fields.

ex: date field column contains 1/28/2005 as data
how to get year(1/28/2005)
how to get month(1/28/2005)


expecting your help

Thanks,
Spec
 
Never expect help :rolleyes: you'll be disappointed when it doesn't come

Look up the Format() function in Access help

Col
 
Also look at DatePart() while you're in the help files.
 
And then there are the named functions - Year() and Month()

Where Year(fld1) = Year(fld2) and Month(fld1) = Month(fld2).

If you need to use ranges, your best alternative is the Format() function but don't forget to put the year first.

Where Format(fld1, "yyyymm") Between Format(fld2, "yyyymm") and Format(fld3, "yyyymm")
 

Users who are viewing this thread

Back
Top Bottom