data pertaining to dates, but date/time data type doesn't work

K

Kendra

I have a question about adding date information to a
database table. For the form, I want people to date the
form with a month and year. So I was planning to create
two pull down menus, one with months listed and one with
years listed. Creating the pull down menus is no problem,
except that I am unsure of what type of data the Month and
Year fields should be (in the table). I want use
date/time data type so that people analyzing the data
could do queries and see all entries for January 2004 or
March 2004, but whenever I type in January or 2004 for a
field, it tells me the data is invalid. How can I make
the form work so that people can select a month and year
AND so that people analyzing the data in the table can do
queries that recognize the dates?
 
N

Naresh Nichani MVP

Hi:

Probably the best way is to make Month and Year number - in Month dropdown
you can make January save as 1 etc. When you query let user query Month and
Year for e.g. Month = 1 and Year = 2004.

Regards,

Naresh Nichani
Microsoft Access MVP
 
J

John Vinson

I have a question about adding date information to a
database table. For the form, I want people to date the
form with a month and year. So I was planning to create
two pull down menus, one with months listed and one with
years listed. Creating the pull down menus is no problem,
except that I am unsure of what type of data the Month and
Year fields should be (in the table). I want use
date/time data type so that people analyzing the data
could do queries and see all entries for January 2004 or
March 2004, but whenever I type in January or 2004 for a
field, it tells me the data is invalid. How can I make
the form work so that people can select a month and year
AND so that people analyzing the data in the table can do
queries that recognize the dates?

I'd use Integer (or long integer) numbers. Date/Times will NOT work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top