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!

Calculate between certain dates

Status
Not open for further replies.

madrappin

Technical User
Mar 16, 2004
68
US
Can anyone help me type this up right? The error I keep getting is "Error: Expected End of Statement" with the BETWEEN highlighted. Everything looks right to me, but I'm not very good with VBA. Thanks for any help.

Code:
DoCmd.OpenReport Me.lstReport, acViewPreview, , tblData.[GC DATE] BETWEEN Now() AND DateAdd("yyyy",-1,Now())
 
You may try this:
DoCmd.OpenReport Me.lstReport, acViewPreview, , "tblData.[GC DATE] BETWEEN DateAdd('yyyy',-1,Now()) And Now()"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top