ADD_MONTHS date issue

General
General covers Articles, Reference documentation, FAQs, Downloads and Blogs that do not belong to a specific subject area. General-purpose Articles about everything and anything
sai
N/A

ADD_MONTHS date issue

Hi,

 

Please help me the below query.

WHERE SEG_DISC >= ADD_MONTHS(CURRENT_DATE, - ${HIST_DT}) not able to replace ${HIST_DT} in bteq script

 

the value of hist_dt am passing it via parameter file script.

 

when i give the acutal value of WHERE SEG_DISC >= ADD_MONTHS(CURRENT_DATE, - 40) gives correct answer

 

TIA

1 REPLY

Re: ADD_MONTHS date issue

Hi,

 

You've probably worked out by now but BTEQ does not have the capability to replace variables in a script. If the SQL is being run using BTEQ then you need to replace variables using operating system capabilities (e.g. shell scripting).

 

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com