How do a query reformated dates in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've reformated a date field so that the name of the month is showing,
however when I try and query the data and use the month name I get an error
saying that the expression has been typed incorrectly or it's too complex to
be evaluated. How can I get a message prompt and just enter the month name
to find all the enteries for that month?
 
You can try this

Select * from TableName Where Month(DateField) = [Please enter the month
number:]
 
Buffy said:
I've reformated a date field so that the name of the month is showing,
however when I try and query the data and use the month name I get an error
saying that the expression has been typed incorrectly or it's too complex to
be evaluated. How can I get a message prompt and just enter the month name
to find all the enteries for that month?


A format is just a way to specify how the data is to be
displayed. It has little if anything to do with what is
actually stored in a field.

To search a table by month name, create a calculated field
in the query:
TheMonth: Format(datefield, "mmmm")
and set its criteria to your prompt.

Note that if the table will ever have data for more than one
year, the month name is not sufficient to distinquish one
year from another.
 
Back
Top