Anniversary Date query

  • Thread starter Thread starter bj
  • Start date Start date
B

bj

Hi there,
I have a query that i need to select all customers that have made a
purchase in a particular month of the year. The query retrieves data from a
table that currently has the date in the following format DD/MM/YYYY. I've
created a parameter query that asks users for the month.

Can I get the results without changing the format of the date in the table.

Thanks
Brett
 
Hi there,
I have a query that i need to select all customers that have made a
purchase in a particular month of the year. The query retrieves data from a
table that currently has the date in the following format DD/MM/YYYY. I've
created a parameter query that asks users for the month.

Can I get the results without changing the format of the date in the table.

The format of the date is completely irrelevant. A date/time value is
stored as a Double Float number, not a text string; the Format merely
controls how that number is converted for display.

I'd suggest putting a calculated field in the query defined as

PurchaseMonth: Month([PurchaseDate])

This will have a number 1 to 12. You can apply a criterion to it.
 
Hi

bj said:
Hi there,
I have a query that i need to select all customers that have made a
purchase in a particular month of the year. The query retrieves data from a
table that currently has the date in the following format DD/MM/YYYY. I've
created a parameter query that asks users for the month.

Can I get the results without changing the format of the date in the
table.


Select * From YourTable Where Month(PurchaseDate)=[PurchaseMonth]

where you replace YourTable with your table name and PurchaseDate with name
of field containing dates. PurchaseMonth is parameter the user is asked for,
and it must be different from any field names in YourTable and from
available variable names. The format of PurchaseDate field? It must be date
(look in table structure editor)! It doesn't matter, in which format it is
displayed so long as it remains a date.


Arvi Laanemets
 
Back
Top