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

trying to query between current dat and the end of month

Status
Not open for further replies.

cal555

Programmer
May 5, 2006
71
US
hi.
I have a Field that has dates, in the mmmm/dd/yyyy.
I want to write a wuery that will give all dates between today through the end of the month.
I am trying something like this but I am not sure how to fully write it.
Between (Format(Date(),"mmmm/dd/yyyy") And Date())

Any ideas I would really appreciate it.
Thank you
 
Don't worry about formats when querying dates or date ranges. Try:
Between Date() And DateSerial(Year(Date()), Month(Date())+1,0)

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]
 



Hi,

I agree with Duane. It is almost always better to work with REAL DATES rather than string representations of dates.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Thank you for your help that looks like it shoud do it, but unfortunantly it is not working; it returned nothing back.
I have these dates:
Date
March/17/2007
March/21/2007
March/15/2007
March/15/2007
March/24/2007
March/29/2007

and as of today I am looking for it return
Date
March/17/2007
March/21/2007
March/24/2007
March/29/2007
any ideas?
 
Are you sure your column contains DATES and not TEXT representations of dates?

Ignorance of certain subjects is a great part of wisdom
 
Hi thanks for you help. The columndid contain date but I mistakenly had it in text format, that is working now.
Thank you
 
Trust me, it will be last time you make that mistake. I am sure we've all been there. When you see it happen once, you NEVER want to see it again :)

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top