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!

query and dates

Status
Not open for further replies.

jamesmills

Technical User
Jul 30, 2003
43
GB
Hello all

I have a table called tblCustomers
and a colum called startDate

startDate is like 00/00/0000

if i make a new query, and i want to select all records from a certain month and certain year how do i do it?

I have made a trop down on the main form with a drop down for month and year.

So if i select Month=02 and year=2003
when i click the button i want the query to pick up all the days for that month!

Will it be somthignm like

**/Forms![frmOpening]![txtMonth] /Forms![frmOpening]!
[txtYear]



thanks
 
You have to make those month and year strings into a complete date string

Month & "/01/" & Year

Then make another date set to the first day of the next month, and create a query that selects all values
Between #date1# and #date2#
 
this is all i had to add to the query..........

>&quot;01/&quot; & [Forms]![frmOpening]![comboSelectMonth] & &quot;/&quot; & [Forms]![frmOpening]![comboSelectYear] And <&quot;31/&quot; & [Forms]![frmOpening]![comboSelectMonth] & &quot;/&quot; & [Forms]![frmOpening]![comboSelectYear]


i thought about what you posted and i sorted it.
thanks
james
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top