Friday, February 10, 2012

Converting oracle calculation to sql server 2005 calculation

Hi I am having to convert some oracle reports to Reporting Services. Where I am having difficulty is with the

calculations.

Oracle

TO_DATE(TO_CHAR(Visit Date+Visit Time/24/60/60,'DD-Mon-YYYY HH24:MISS'),'DD-Mon-YYYY HH24:MISS')

this is a sfar as I have got with the sql version

SQLSERVER2005

= DateAdd("s",Fields!VISIT_DATE.Value,Fields!VISIT_TIME.Value\24\60\60 )

visit_date is date datatype visit_time is number datatype. have removed : from MI(here)SS as was showing as smiley.

using:

VS 2005 BI Tools

SQLServer 2005

You need SQL Server convert code 13 or 113, try the link below for all the conversion codes. Hope this helps.

http://sqljunkies.com/HowTo/6676BEAE-1967-402D-9578-9A1C7FD826E5.scuk

|||

Thanks for the reply, I tried....

= Convert(varchar(10),DateAdd("s",Fields!VISIT_DATE.Value,Fields!VISIT_TIME.Value\24\60\60,103)

'Convert' is underlined red tool tip says 'unrecognised identifier'

|||

The link I gave you is for you to do the caculations in the database not Reporting services table control Expression box.

|||Thanks, much easier doing calculated fields in db.

No comments:

Post a Comment