Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

qliksase
Not applicable

Question concerning Date and Long Timestamps in SQL Database

Hi dear Qlik Community,

before I start with my question, I wanted to say that the Qlik Community is maybe the best online help forum on the internet.

I need to load data from an SQL Server and put it into a QVD. I have serious problems with a Timestamp field.

These are the options concerning the field:1

This is how the data looks on the SQL Database:

This is how it looks in my QVD File:

Here is my Statement:

OEE_RES_STATE_SAMP:
LOAD text(RSS_TIMESTAMP_START) as NewDate;

SQL SELECT "RSS_TIMESTAMP_START"
FROM xxx.dbo."xxx_xxx_xxx_xxx";

All I want to do is to make a date out of this timestamp -> yyyy-mm-dd hh:mm:ss.fff

Would anybody please assist me ?

Thank you in advance

1 Solution

Accepted Solutions
sergio0592
Not applicable

Re: Question concerning Date and Long Timestamps in SQL Database

Hi, try with :

OEE_RES_STATE_SAMP:

LOAD timestamp#(RSS_TIMESTAMP_START,'YYYYMMDDhhmmss') as NewDate;

But i don't know what are your last three digits? Mili seconds?

3 Replies
sergio0592
Not applicable

Re: Question concerning Date and Long Timestamps in SQL Database

Hi, try with :

OEE_RES_STATE_SAMP:

LOAD timestamp#(RSS_TIMESTAMP_START,'YYYYMMDDhhmmss') as NewDate;

But i don't know what are your last three digits? Mili seconds?

qliksase
Not applicable

Re: Question concerning Date and Long Timestamps in SQL Database

Thank you for the fast response. The hint didn't work, I think the problem is the length of this numeric value in the database. But I found a different solution in the meantime:

LOAD date#(Left(((RSS_TIMESTAMP)/100000),8), 'YYYYMMDD') as %Date

By using this function I get a correct date.

Thank you for your help.

Not applicable

Re: Question concerning Date and Long Timestamps in SQL Database

"before I start with my question, I wanted to say that the Qlik Community is maybe the best online help forum on the internet."
this is so true

(just saying)

hope i can make my own document soon since i'm new here in qlikview