View previous topic :: View next topic
|
Author |
Message |
Sanath sekhar Reddy N
New User
Joined: 31 Oct 2012 Posts: 30 Location: INDIA
|
|
|
|
Hi
Iam having requirement of below query.
to add date to the numeric value and compare with the date .
like as below
start-date + term < = 01.04.2013
where for eg start-date is 01.01.1998 and term is value 14 ,then 01.01.1998 + 14 years = 01.01.2012 < = 01.04.2013 ,then this record should be extracted in output from database table.
how to query this in sql,pls help me
regards
Sanath |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
So what are the columns of the table and the host variables? (Names and definitions, please). |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Sanath,
Please try below mentioned SQL
Code: |
select * from table_name
where
date(Start_date) + 14 Year <= '2013-01-04' |
|
|
Back to top |
|
|
Sanath sekhar Reddy N
New User
Joined: 31 Oct 2012 Posts: 30 Location: INDIA
|
|
|
|
Hi
I have tried this
select * from table_name
where
Date-field + 14 Year <= '2013-01-04'
This worked.
Thanks Sai for the timely response, Thanks to Akatsukami
also who responded in time .
Thank you very much.
Regards
Sanath sekhar reddy |
|
Back to top |
|
|
|