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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date wild card issue

Status
Not open for further replies.

wheels27

MIS
Aug 26, 2002
30
US
i need to write a query that looks at month and year but can use a wild card for the date there for pulling all date within a paticulare month and year would i use the following 08/??/2001 or is it differant.

?? being my wild card or what is the wild card for a query
 
You could use the DatePart function like so -

(DatePart("m", [OrderDate]) = 8) and (DatePart("yyyy", [OrderDate]) = 2001)

 
but you can't use a wild card character in an actual date type field. not even as a part of a parameter. You COULD use a calculated field and use an modified date string as the parameter criteria:

MyCaldDt: Format([the date field], "mmyy")

And then have the criterial be "0802"

And -of course- there are a LOT of variations on this theme!


MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top