Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rittermd
Honored Contributor

DateTime Conversion

I have a field coming from my source that is a datetime field in MS SQL table.

I want to convert this to the numeric value for the date/time like Qlik does internally.

This is the code in the script.  The field that I am working with is ImportTime.  The variable is already in the numeric form.

The reason that I am doing this is when all dates were in regular date/time format the where clause was ignoring the seconds of the time and I was getting duplicates.

I can't figure out what I need to code in SQL to do this conversion.

StopData:

  LOAD * ;

  SQL SELECT *

  from Source

  WHERE ImportTime > $(vDeltaFieldValue)

            And Branch < '800';

2 Replies

Re: DateTime Conversion

May be use TO_DATE function which is similar to QlikView's Date#() or TimeStamp#() functions

SQL TO_DATE Function - 1Keydata

vinieme12
Esteemed Contributor II

Re: DateTime Conversion

Community Browser