on 06-27-2013 8:55 PM
Hi all,
My database is Sybase IQ. I am trying to convert the below logic from oracle to sybase it is throwing me error.
Please help me in converting them is Sybase IQ and I need to inculde YTD,QTD.
Thanks a lot
@Select(Orders\Order Date) BETWEEN
decode(@Prompt('Date Range','A',{'Yesterday','WTD','Last Week','MTD','Last Month','Last 7 Days','Last 30 Days','Last 60 Days','Last 90 Days','Custom'},MONO,CONSTRAINED),
'Yesterday',trunc(sysdate)-1,
'WTD',next_day(trunc(sysdate)-8,'Sunday'),
'Last Week',next_day(trunc(sysdate)-15,'Sunday'),
'MTD', last_day(add_months(trunc(sysdate)-1,-1))+1,
'Last Month', last_day(add_months(trunc(sysdate)-1,-2))+1,
'Last 7 Days', trunc(sysdate)-7,
'Last 30 Days', trunc(sysdate)-30,
'Last 60 Days',trunc(sysdate)-60,
'Last 90 Days',trunc(sysdate)-90,
'Custom',@Prompt('First Date (applies only if date range is "Custom")','D',,MONO,FREE,NOT_PERSISTENT,{'01/01/1900'}),
trunc(sysdate)-1)
AND decode(@Prompt('Date Range','A',{'Yesterday','WTD','Last Week' ,'MTD','Last Month','Last 7 Days','Last 30 Days','Last 60 Days','Last 90 Days','Custom'},MONO,CONSTRAINED),
'Last Week',next_day(trunc(sysdate)-8,'Saturday'),
'Last Month', last_day(add_months(trunc(sysdate-1),-1)),
'Custom',@Prompt('Last Date (applies only if date range is "Custom")','D',,MONO,FREE,NOT_PERSISTENT,{'01/01/1900'}),
trunc(sysdate)-1)
have you tried asking in Sybase forums ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.