Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
qliksase
New Contributor

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
Valued Contributor II

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?

View solution in original post

3 Replies
sergio0592
Valued Contributor II

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?

View solution in original post

qliksase
New Contributor

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