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!

date calculations

Status
Not open for further replies.

mossbs

Programmer
Aug 19, 2008
102
GB
hey guys,

right, i need to write a procedure to add in a renewal payment plan for members.

the adding in bit is fine its just the pulling the correct people i am struggling with due to calculating dates etc.

our renewals process starts 2 months before they are due to renew etc so if i were to run it today i would need to pull people for may etc.

my problem lies in that members will have an 'attribute' on their record which is a ref number linked to a lookup table that gives the description of that attribute reference but i also need to include getdate into the equation to calculate 2 months in advance etc.

so essentially i need to pull people where the description (lookup_full_desc) = datename(month, getdate()) (but plus 3 months)

any ideas?

as always... apologies if none of the above makes sense - has been a long day!

cheers,

dan
 
Code:
(lookup_full_desc) = datename(month,dateadd(m,3,getdate())
 
pwise....you sir are a gent!

i knew it was something along those lines just couldnt remember the correct syntax!

cheers buddy!

dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top