cancel
Showing results for 
Search instead for 
Did you mean: 

Need helps in fixing the logic

former_member203645
Active Participant
0 Kudos

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)

Accepted Solutions (0)

Answers (1)

Answers (1)

denis_konovalov
Active Contributor
0 Kudos

have you tried asking in Sybase forums ?

former_member203645
Active Participant
0 Kudos

My question is more related to BO,

I will do and I think it is a right place .

denis_konovalov
Active Contributor
0 Kudos

it's not really a BO problem. You're converting Oracle SQL into Sybase SQL that's all.

Sybase SQL experts are more frequent in the Sybase forums

former_member203645
Active Participant
0 Kudos

Yes I posted in that forum. Thanks

CdnConnection
Active Contributor
0 Kudos

RUC,

      This should be posted in the Semantic forum.  The Semantic layer takes care of ALL SQL related issues that is used by the BOBJ suite of tools.

Dennis please move this to the Semantic Layer blogs

Ajay