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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SELECT from SQL Database issue

Hi,

i'm having trouble using DataManager loading data from a database.

I already connected my APP with database and try to get some rows in the table.

There is a colum 'FILLINDATE' in this table. And I want to apply a filter before loading from the table, so I dont have to load all data from the table. This colum has the format" 01/01/2016 00:00:00 AM"

As my understanding, applying this filter equals adding the read "Where FILLINDATE>='2018'" below.

Select

     xxx

     xxx

     xxx

FROM xxx Where FILLINDATE>='2018'


I tried several SQL such as CONVERT(), or Date but none of these works.

Thanks for any tips.


1 Solution

Accepted Solutions
undergrinder
Specialist II
Specialist II

Hi Zhitao,

what kind of db do you use as source?

if Oracle then try

Where trunc(FILLINDATE) >= to_date('2018-01-01','yyyy-mm-dd')

if MSSQL,

Where year(FILLINDATE)>=2018

if Postgres:

Where FILLINDATE::date >= '2018-01-01'::date

So the where condition syntax should fit to the database server.

G.

View solution in original post

3 Replies
undergrinder
Specialist II
Specialist II

Hi Zhitao,

what kind of db do you use as source?

if Oracle then try

Where trunc(FILLINDATE) >= to_date('2018-01-01','yyyy-mm-dd')

if MSSQL,

Where year(FILLINDATE)>=2018

if Postgres:

Where FILLINDATE::date >= '2018-01-01'::date

So the where condition syntax should fit to the database server.

G.

Anonymous
Not applicable
Author

Thanks a lot. It's a Oracle db.

BalaBhaskar_Qlik

Give the complete format and try like this:

FROM xxx Where FILLINDATE>='01/01/2018 00:00:00 AM'