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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
josephinetedesc
Creator III
Creator III

help with dates in SQL

Re: Help with Sql Where Date >

Hi All

I have looked at the discussion above but I need help to do the following:

Below is the current script to get the dates I am interested in - however what I want is not to hard code the ScheduledDate.  I would like to change  ScheduledDate < '2017-09-01'

and make it  ScheduledDate < today() + 30

Is this possible given that 'today() + 30' is is qlikview but it is part of an SQL select?

Thank you

Jo

aaa:

SQL SELECT *

FROM Cccc.dbo.[vwdr_ppDays]

  where ScheduledDate >= '2016-01-01' and ScheduledDate < '2017-09-01'

;

STORE

aaa INTO

[aaa.qvd] (qvd);

drop table aaa;

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

Try

Let vDate =Date(Floor(Today())+30,'YYYY-MM-DD');

View solution in original post

5 Replies
sunny_talwar

May be this

aaa:

SQL SELECT *

FROM Cccc.dbo.[vwdr_ppDays]

  where ScheduledDate >= '2016-01-01' and ScheduledDate < (SYSDATE + 30);

sasiparupudi1
Master III
Master III

Let vDate ='Date (Floor (Today ())+30),''YYYY-MM-DD'')'

In the sql where condition,

ScheduledDate<'$(vDate)'


hth

Sasi

josephinetedesc
Creator III
Creator III
Author

Let vDate ='Date(Floor(Today())+30),''YYYY-MM-DD'')';

on using debug this s gives vDate as :"Date(Floor(Today())+30),'YYYY-MM-DD')"

and causes a problem when trying to use it.

Let vDate =Date(Floor(Today())+30);  this gives the vDate as 7/09/2017 but then the problem is that it is in the wrong format.

Jo

sasiparupudi1
Master III
Master III

Try

Let vDate =Date(Floor(Today())+30,'YYYY-MM-DD');

josephinetedesc
Creator III
Creator III
Author

Thank you that worked!  Where could I have found information about how to worked with dates as text???