Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
amithmurali
Partner - Creator II
Partner - Creator II

Filter Date while Loading From Database

Hi guys,

I have a Problem in my DB. When i load the data from 2014. in some places, because of the user error. there some dates like 2090,2030 etc and also months.

How to filter data while loading from 2014 jan 1st to Todays date.

This is the filter which i used while loading the data to get data from 2014 jan1st.

FROM cmsdhcc.dbo."department_income_view"  where YEAR("d_date") >=2014;

1 Solution

Accepted Solutions
crusader_
Partner - Specialist
Partner - Specialist

Hi,

You can add where filter in your SQL statement smth like below:

where YEAR("d_date") >=2014 and "d_date"<=GETDATE(); - example for SQL server


or

You can filter out in your LOAD satement:

LOAD *

Where date(d_date)<=today()

;

SQL SELECT ...


Hope this helps you.


Regards,

Andrei

View solution in original post

2 Replies
crusader_
Partner - Specialist
Partner - Specialist

Hi,

You can add where filter in your SQL statement smth like below:

where YEAR("d_date") >=2014 and "d_date"<=GETDATE(); - example for SQL server


or

You can filter out in your LOAD satement:

LOAD *

Where date(d_date)<=today()

;

SQL SELECT ...


Hope this helps you.


Regards,

Andrei

PrashantSangle

Hi,

Use and trunc(d_date)<=trunc(sysdate())

try below

FROM cmsdhcc.dbo."department_income_view"  where YEAR("d_date") >=2014 and trunc(d_date)<=trunc(sysdate());

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂