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!

I'm trying to set the recordset for

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I'm trying to set the recordset for a form to show all leases that renewed the previous month. For example it is now January if I open the form I want the recordset to show all leases that renewed in December, next month, February, I want the forms recordset to list all leases that renewed in January, etc...

I'm currently using a query to load the forms recordset and as a criteria for the renewal date field I am using the following:

DatePart("m",Date())-1

This returns no records yet if I change remove the "-1" it returns all renewals for this month. If I replace "-1" with "+1", it correctly returns all renewals the will occur in February.

I cant seem to look back. Could this be because last month was a different year?

Thanks so much for the help.
 
What is the SQL code of the query ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Could be, since Date is a reserved word, you need to:
1. Change the field name (recommended)
2. Use brackets [Date]



Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top