Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

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
sunny_talwar

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

SQL TO_DATE Function - 1Keydata

vinieme12
Champion III
Champion III

Use convert or cast

https://www.techonthenet.com/sql_server/functions/index_alpha.php

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.