use the name of a month to query in a date field (1 Viewer)

megatronixs

Registered User.
Local time
Today, 17:56
Joined
Aug 17, 2012
Messages
719
Hi all,

I'm looking into passing a month name from a combobox in a form to a query and get the results for that month. If I would use November, I should get all the records that fall in November.
Is this possible? the field that I try to do this is called "pickup_date"

Greetings.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:56
Joined
May 7, 2009
Messages
19,245
yes, you can.
if you only want to get to show
the query for this year:

select yourTable.*, Format([pickup_date],"yyyymmmm") As Expr1 From yourTable Where Format([pickup_date],"yyyymmmm") = Year(Date()) & [Forms]![yourFormName]![yourCombo]
 

megatronixs

Registered User.
Local time
Today, 17:56
Joined
Aug 17, 2012
Messages
719
Hi, it works really great, no clue it could be done this way :)

Greetings
 

Users who are viewing this thread

Top Bottom