Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting a month from a date in a query

Status
Not open for further replies.

timnicholls

Technical User
Oct 31, 2003
43
AU
Hi All.

On a form I have two comboboxes.
One populated with years and the other with months in a year.

So a user can select say 2002 and March.

Now these values have to be transfered to a query so that from a column of dates in a table called "Entry Dates" we can find those who entered a program on March 2002.

A report is then created on that query.

It has to be user configurables of course with the selection of the month and year with the comboboxes being dynamic. We cannot hard code the query...

Has anybody done this before?
How do we just get the month and year from a date and ignore the day?

Any help would be appreciated.

Thanks
Tim
 
hi

see

Month(Date()) returns month as 1-12
Year(Date()) returns year number eg 2003
Format(Date(),"mmm") returns month eg Nov
Format(Date(),"yyyy") returns year as a string

in help,

between those functions you shoul be able to do what you require

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi Ken,

I hope you enjoyed your fireworks evening ;-)

OK, I will investigate those functions involving dates.

Thanks
Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top