Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
amithmurali
Partner
Partner

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
Partner

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
Partner

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.