MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL Help for finding a date + nn days

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
cappertan
Beginner


Joined: 20 May 2003
Posts: 15
Topics: 10

PostPosted: Wed Jan 25, 2006 11:17 am    Post subject: SQL Help for finding a date + nn days Reply with quote

Hi:

After reading posts, I am still confused. I think I am close but do not have the syntax right. *** My goal is to find all date greater than that date + 84 days. Beg_dt are dates in my test database.

WHERE A.id = '1234'
AND A.RANGE IN ('V24.2', 'V72.31')
AND B.BEG_DT > ('2004-08-01' + 84 DAYS)

Eventually, in cobol/easytrieve I want replace that hardcoded date with a host variable (:INDATE).

Thanks for your suggestions.
_________________
Capp
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Jan 25, 2006 11:54 am    Post subject: Reply with quote

cappertan,

Try this

Code:

WHERE A.id      = '1234'
  AND A.RANGE  IN ('V24.2', 'V72.31')
  AND B.BEG_DT  > DATE(:IN-DATE) + 84 DAYS


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group