Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

How to give where condition on date in SQL

Hi,

I am loading the data from a VIEW which is created in SQL but WHERE condition is not working.  

 

SQL

SELECT * FROM NEWC."VIW_MONTHLY" WHERE CALLDATE>='01/01/2013 00:00:00';

condition is not working im getting all 2010 data also. Kindly help me...

14 Replies

Re: How to give where condition on date in SQL

Try this.

     SQL

     Select * from NWEC."VIW_MONTHLY" where CALLDATE >= '01-Jan-2013';

Regards,

Kaushik Solanki

Not applicable

Re: How to give where condition on date in SQL

No it is not working it pulling all 2010 records also. this field contains Date & Time also.

udit_kumar_sana
Contributor II

Re: How to give where condition on date in SQL

Hi ,

Try to do this in QVW i.e after making Qvd of this query ,fetch this qvd in new qvw and apply this where condition w.r.t to date format that is fetched from qvd.

Regards,

Udit

Not applicable

Re: How to give where condition on date in SQL

But whole data cant be fetch because the VIEW dont have WHERE clause so it will pull everything from database and database contains records from 2010. for one month only data will be 80-90k records.

udit_kumar_sana
Contributor II

Re: How to give where condition on date in SQL

Hi,

Then fetched the whole data for one time and then put it to incremental load.

Regards,

Udit

Not applicable

Re: How to give where condition on date in SQL

This has to done in daily basis so it is not possible

Re: How to give where condition on date in SQL

Dear Rashmi,

     Try this.

     Select * from NWEC."VIW_MONTHLY" where to_date(CALLDATE,'DD-Mon-YYYY') >= '01-Jan-2013';

Regards,

Kaushik Solanki

Not applicable

Re: How to give where condition on date in SQL

It is giving for this query...

ErrorSource: OraOLEDB, ErrorMsg: ORA-01843: not a valid month

Re: How to give where condition on date in SQL

Try this.

Select * from NWEC."VIW_MONTHLY" where CALLDATE  >= to_date('01-Jan-2013' ,'DD-MON-YYYY')

Regards,

Kaushik Solanki