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

Stored procedure to filter records between getdate() minus 1-3 months 1

Status
Not open for further replies.

ebic

Technical User
Jun 28, 2007
8
CA
I'm trying to create a stored procedure to display the records in an incident database for the last 30, 60, or 90 days.

I have tried
"Between Date( ) And DateAdd("M", -1, Date( ))"
but the access projects gives me the error
"ADO error:'Date' is not a recognized function name."

I tried changing date to getdate but it still errors out.

This database stores incidents and complaints about employees and we can only take action if the complaints are within a set period of time.

TIA for any assistance.
 
>= DATEADD(M, - 6, GETDATE())

works for me. Note - no quotes round the M.
 
Thanks ajrimmer for the assistance.

I was tied up on another project and I finally got a chance to try your solution and it worked like a charm.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top