cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

convert sql timestamp to dateformat

Former Member
0 Likes
486

I have data from sql timestamp how can I convert this into dd/mm/yyy hh:mm:ss

Attach is the screenshot

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi Mohit ,

I just wan to know that  are you using SAP Oracle or SQL server for fetching the data to the Web Intelligence.

If it is external then my question is on different track

Thanks

Former Member
0 Likes

Using Sql Server 2008 R2. If this is timezone difference. Then I am using windows 2008  R2 Enterprise SP1.

So I have to change timezone in sql ?

Thanks,

Mohit

Former Member
0 Likes

No, you could just subtract (or add) a fixed number of hours as required.

So, if your data is five hours ahead, you could use

dateadd(s,table.column-18000,'1970-01-01')

Just use multiples of 3600 for each hour that you are different from what it should be

Former Member
0 Likes

Thanks mark it worked

Answers (1)

Answers (1)

Former Member
0 Likes

If you are on SQL Server, create a universe object as:

dateadd(s,table.timestampcolumn,'1970-01-01')

If you're on webi, use

=RelativeDate(ToDate("19700101";yyyyMMdd);[Timestamp]/86400)

Former Member
0 Likes

Hi Mark,

Thanks for the reply. Yes I apply the same in sql but I am getting the date correct but time is not coming correct. Because in application the time entered differ from sql when apply this dateadd function

Thanks,

Mohit

Former Member
0 Likes

That could be a timezone issue.