SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 17th, 2003, 02:38 PM
burnoutuk burnoutuk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Nottingham England
Posts: 7 burnoutuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old October 20th, 2003, 09:21 AM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
tblMember.renewalDate CANNOT BE <=Month(Date())-1))
you have to compare months with months

Reply With Quote
  #3  
Old October 20th, 2003, 09:23 AM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
by the way Dec 2000 and Dec 2001, ... all yield 12 for the month!!!

Reply With Quote
  #4  
Old October 20th, 2003, 11:04 AM
burnoutuk burnoutuk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Nottingham England
Posts: 7 burnoutuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Last edited by burnoutuk : October 20th, 2003 at 11:34 AM.

Reply With Quote
  #5  
Old October 20th, 2003, 11:18 AM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
WHERE Month([tblMember].[renewalDate]) = Month(Date()-1) AND Year([tblMember].[renewalDate]) = Year(Date()-1)

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Renewal Date


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT