If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Parameter query for parts of date
My date field is the traditional mm/d/yy format. I need to
create a parameter query that asks for the month and then the year. I'm sure DatePart comes into this somewhere, but wild guesses at the right way to word my criteria have failed. |
#2
|
|||
|
|||
Parameter query for parts of date
Create a couple of calculated fields in your query, one to represent the
month and one for the year. You can either use DatePart, or the Month and Year functions. Place your parameters relative to those computed fields. The SQL would look something like: SELECT Field1, Field2 FROM MyTable WHERE Month(MyDate) = [Enter Month Number] AND Year(MyDate) = [Enter Year] -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Rose" wrote in message ... My date field is the traditional mm/d/yy format. I need to create a parameter query that asks for the month and then the year. I'm sure DatePart comes into this somewhere, but wild guesses at the right way to word my criteria have failed. |
Thread Tools | |
Display Modes | |
|
|