Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Equivalent of to_date function in Ms SQL and using it in Evaluate function

866045Jun 2 2011 — edited Jun 3 2011
Hi,

I am trying to find out a function in MS SQL which is equivalent to to_date function in oracle. Please find below the advanced filter i am trying to use in OBIEE.

Evaluate('to_date(%1,%2)' as date ,SUBSTRING(TIMES.CALENDAR_MONTH_NAME FROM 1 FOR 3)||'-'||cast(TIMES.CALENDAR_YEAR as char(4)),'MON-YYYY')>=Evaluate('to_date(%1,%2)' as date,'@{pv_mth}'||'@{pv_yr}','MON-YYYY') and Evaluate('to_date(%1,%2)' as date ,SUBSTRING(TIMES.CALENDAR_MONTH_NAME FROM 1 FOR 3)||'-'||cast(TIMES.CALENDAR_YEAR as char(4)),'MON-YYYY') <=timestampadd(sql_tsi_month,4,Evaluate('to_date(%1,%2)' as date,'@{pv_mth}'||'@{pv_yr}','MON-YYYY'))

The statement above works fines with oracle DB with to_date function. The same statement throws an error with MS SQL since to_date is not a built in function.

With MS SQL I tried with CAST, not sure how to pass parameters %1 and %2.

Please help me how to use Evaluate function and passing parameters along with to_date funtion in MS SQL.

Regards!
RR
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details