Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Transact-SQL to QlikView code

Hi all there,

I'm a fairly new guy here in the QlikView community,

I'm having some difficulties putting a Transact SQL statement into QlikView.

Can someone give me an Idea in the right direction?

Statement:

CASE DUEBYTIME WHEN 0 THEN NULL

ELSE dateadd(s, datediff(s, GETUTCDATE(), getdate()) + (DUEBYTIME / 1000), '1970-01-01 00:00:00') END AS Verval_Datum

Thanks in advance.

4 Replies
Not applicable
Author

Try with this:

(case when (DUEBYTIME=0) then Null() else dateadd(s, datediff(s, GETUTCDATE(), getdate()) + (DUEBYTIME / 1000), '1970-01-01 00:00:00') end) As Verval_Datum

Not applicable
Author

Hi quique,

It seems Qlikview is troubled with te expressions:

dateadd(s, datediff(s, GETUTCDATE(), getdate())

ave you got there an QV alternative?

Thx in advance.

rohit214
Creator III
Creator III

hi herman

try this

if(DUEBYTIME=0,Null(),Date(addmonths(datefield,'DD/MM/YYYY'),0)+(DUEBYTIME / 1000))As Verval_Datum

please specified that s,GETUTCDATE what are these fields or table name

thanks

rohit'

Not applicable
Author

GETUTCDATE() is a transact SQL statement:

Microsoft writes:

Returns the current database system timestamp as a datetime value. The database time zone offset is not included. This value represents the current UTC time (Coordinated Universal Time). This value is derived from the operating system of the computer on which the instance of SQL Server is running.

Verval_Datum is a alias for a talbefield related to the field DUEBYTIME.

Greetz, Herman.