Home > SQL Development > Renewal Date

Renewal Date



Im stuck on another query.



I need a query that gives me members whos membership is going to run out in a month or under.





SELECT tblMember.memberNo, tblMember.dateJoined, tblMember.renewalDate



FROM tblMember



WHERE (((tblMember.renewalDate)<=Month(Date())-1))



ORDER BY tblMember.memberNo;



i think it should look something like that but theres something wrong somewhere.

    
Guest


tblMember.renewalDate CANNOT BE <=Month(Date())-1))

you have to compare months with months

Was this answer helpful ? Yes No   
Guest


by the way Dec 2000 and Dec 2001, ... all yield 12 for the month!!!

Was this answer helpful ? Yes No   
Guest


SELECT [tblMember].[memberNo], [tblMember].[dateJoined], [tblMember].[renewalDate]



FROM tblMember



WHERE (([tblMember].[renewalDate]) <DateAdd("m",1,Date()))



ORDER BY [tblMember].[memberNo];





That seems to work ok Thank you m_lazor for the responses to both posts

Was this answer helpful ? Yes No   
Guest


WHERE Month([tblMember].[renewalDate]) = Month(Date()-1) AND Year([tblMember].[renewalDate]) = Year(Date()-1)

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved