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

Using now() with a timestamp

I am trying to use the date: now() + 06:00. This means: The current data at six o' clock in the morning.

The used database is Microsoft SQL Server.

Newest version of Qlikview 12.

ODBC CONNECT TO data (XUserId is GbYAeHRICaQeFXRODLZA, XPassword is eGXUQGVORJNQEaVMUBQCA);

LET DateNow = Timestamp(text(Date(Now( ), 'yyyy/mm/dd ')) && ’06:00:00’,’yyyy/mm/dd hh24:mm/ss’);

SQL SELECT Customer

FROM DepotSoftware.dbo.tblCustomer

WHERE DateOut > '$(DateNow)'

Does this work?

Can you use DateNow as startup parameter of the report?

Thank you,

Toon Schilder

4 Replies
swuehl
MVP
MVP

Your LET statement defining the variable shows some issues (syntax, format codes) and should return an error when executed.

You can do it like

LET DateNow = Timestamp(floor(Now(1))+Time#('06:00','hh:mm'),'YYYY/MM/DD hh:mm:ss');

or

LET DateNow = Timestamp(Daystart(Now(1),0,0.25),'YYYY/MM/DD hh:mm:ss');

Anonymous
Not applicable
Author

That sounds very good. I will try that.

In stead of using Now(1) I guess it's also possible to use a parameter when starting up the report?

Is it easy to default this parameter to today?

Anonymous
Not applicable
Author

Shouldn't the date format be set like this:

SET TimestampFormat='YYYY/MM/DD hh:mm:ss[.fff]';



MarcoWedel

another one:

LET DateNow = Timestamp(Today()+'06:00','YYYY/MM/DD hh:mm/ss');

hope this helps

regards

Marco