-
July 26th, 2013, 10:55 AM
#1
Retrieve all records for 5 mths from now regardless of year
The following code works to bring back records from an Access2007 database that have a renewal month 5 months from current month. I would like to further delineate by year? I want only records 5 months from current date or, December of 2013. When I run next month it would be for January of 2014 etc... It currently brings back all renewal dates in December regardless of year, for example December of 2022. Thanks so much for the help.
rs.Open "SELECT * Owners INNER JOIN Renewal ON Owners.Owner = Renewal.Comp " _
& "WHERE Owners.FOorSA = 'FO' And " _
& "DatePart(""m"", Renewal.RenewalDte) = DatePart(""m"", NOW) + 5", Conn, adOpenStatic, adLockOptimistic
Eddy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|