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

month-to-date search

Status
Not open for further replies.

ndltx5

Technical User
Jun 6, 2007
26
0
0
US
I have a form with a beginning and end date range search that filters a query what code to I put in the beginning box so that it always defaults to the first day of the current month?
 
Set the default value to:

="01/" & month(date()) & "/" & year(date())

Ed Metcalfe

Please do not feed the trolls.....
 
I prefer to explicitly work with date values and functions. Try:
=DateSerial(Year(Date()),Month(Date()),1)
or
=DateAdd("d",-Day(Date())+1,Date())


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I have a mental block on those functions for some reason. I frequently get reminded that they are a far better way of doing it but for some reason I just can't get them to stick in my brain long enough for them to become habit. :)

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top