Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Date

Hi

I would like to load a script. It connects to a DB and there i would like to load the data.

Is it possible to get the day yesterday and put it into where?

4 Replies
Andrea_Ghirardello

you can put the date into a variable:

Let yourVariable = Date(Today() -1);

MayilVahanan

Hi

Yes it's possible

Try like this

Load * where datefield <= Date(today()-1);

Select * from tablename;

Note:

both datefields are in same format

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
swuehl
MVP
MVP

Maybe like this:

Let vYesterday = date(today()-1,'YYYY-MM-DD'); // should match the format of your DB

SELECT DATE FROM DB WHERE DATE = '$(vYesterday)';

Not applicable
Author

Like this in your edit script:

Let vDateToday = date(Today()-1);

Otherwise you could go to settings - > Variable overview -> add new and type date(today()-1)

You could also use this in your where statement from SQL

Where cast(date as date) = cast(getdate()-1 as date)