|
|
| Author |
Message |
sathish_rathinam
Active User
Joined: 22 Aug 2005 Posts: 56 Location: india
|
|
|
|
| Code: |
EXEC SQL
DECLARE CSR3_DOC CURSOR WITH HOLD FOR
SELECT
DOC_CATEGORY_CODE
,DATE_TIME_PRODUCED
FROM
TEJDOCD_DOC_DAT
WHERE
DOC_CATEGORY_CODE = :TEJDOCD.DOC-CATEGORY-CODE
AND (MONTHS(CURRENT DATE) – MONTHS(DATE(DATE_TIME_PRODUCED)))>:
TEJRFDC.DOC-RETENTION-PD
FOR
FETCH ONLY
END-EXEC. |
I need to find the difference between two dates in terms of months in this query.but iam getting SQL error -440.can u pls help me out . |
|
| Back to top |
|
 |
References
|
Posted: Fri May 16, 2008 4:42 pm Post subject: Re: Query not working ... |
 |
|
|
 |
sathish_rathinam
Active User
Joined: 22 Aug 2005 Posts: 56 Location: india
|
|
|
|
Also ,
| Code: |
EXEC SQL
DECLARE CSR3_DOC CURSOR WITH HOLD FOR
SELECT
DOC_CATEGORY_CODE
,DATE_TIME_PRODUCED
FROM
TEJDOCD_DOC_DAT
WHERE
DOC_CATEGORY_CODE = :TEJDOCD.DOC-CATEGORY-CODE
AND (YEARS(CURRENT DATE) – YEARS(DATE(DATE_TIME_PRODUCED)))>:
TEJRFDC.DOC-RETENTION-PD
FOR
FETCH ONLY
END-EXEC. |
need to find the difference between two dates in terms of years in this query.but iam getting SQL error -440.can u pls help me out . |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 2292 Location: italy
|
|
| Back to top |
|
 |
sathish_rathinam
Active User
Joined: 22 Aug 2005 Posts: 56 Location: india
|
|
|
|
| can u pls tell me how to correct the sqls above as per my requirement |
|
| Back to top |
|
 |
ksk
Active User
Joined: 08 Jun 2006 Posts: 229 Location: Pune
|
|
| Back to top |
|
 |
acevedo
Active User
Joined: 11 May 2005 Posts: 256 Location: Spain
|
|
| Back to top |
|
 |
|
|