Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
malome64
Contributor
Contributor

How load Datetime Column from SQL?

SQL column Datum is DateTime Type, but Time part is 00:00:000.

I tested 3 metods conversion column Datum.

In QVD, DatumSQL convert to Date (32bit integer), another two to 32bit Integer + String. I need show DatumStr format on sheets.

But what about size QVD and Set Analysis?

Which date format I should use in LOAD Script?

1 Solution

Accepted Solutions
daveamz01
Creator III
Creator III

Hi Marian,

It is better to use the preceding load and format the date using Qlik's Date() function or Timestamp() if you want to keep also the time. Or, as the best practice dictates, it is better to split the date and the time in separate fields:

Test:

LOAD

     Date(Floor(Datum), 'DD.MM.YYYY') AS Date, //Floor will keep only the date from a timestamp

     Time(Datum, 'hh:mm:ss')                     AS Time;

SQL SELECT

      Datum

FROM dbo.table;

Regards,

David

View solution in original post

2 Replies
daveamz01
Creator III
Creator III

Hi Marian,

It is better to use the preceding load and format the date using Qlik's Date() function or Timestamp() if you want to keep also the time. Or, as the best practice dictates, it is better to split the date and the time in separate fields:

Test:

LOAD

     Date(Floor(Datum), 'DD.MM.YYYY') AS Date, //Floor will keep only the date from a timestamp

     Time(Datum, 'hh:mm:ss')                     AS Time;

SQL SELECT

      Datum

FROM dbo.table;

Regards,

David

marcus_sommer
MVP & Luminary
MVP & Luminary

I suggest just to load Datum from the database and convert it properly (pure numeric will be sufficient) within a Preceding Load and connect this field to a master-calendar: How to use - Master-Calendar and Date-Values‌ which could contain all your needed period-fields in all formattings.

- Marcus