Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Sql Where Date >

Hi

I can´t get a where statement to work when I load data from a sql db.

Sql Select *

FROM dbo.OVA
Where Date(Datefield) >= '2015-01-02';

When loaded into QV the datefield are

2015-01-01 00:00:00

2015-01-02 00:00:00

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I expect this to work as well:

Sql Select *

FROM dbo.OVA
Where Datefield >= '2015-01-02';

View solution in original post

9 Replies
sunny_talwar

Have you tried doing like this maybe:

Table:

LOAD *

Where Date(Datefield) >= '2015-01-02';

Sql Select *

FROM dbo.OVA;


Best,

Sunny

Anonymous
Not applicable
Author

I expect this to work as well:

Sql Select *

FROM dbo.OVA
Where Datefield >= '2015-01-02';

sunny_talwar

That is good to know Michael Solomovich.

With my little experience, I haven't done any manipulations in the SQL part of the script. Is there a good post/blog which gives the possible things which can be done within SQL part?

Thanks,

Sunny

PrashantSangle

Hi,

In SQL Date use use tochar() or todate() for date manipulation

and date format like 01-Mar-2015

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 🙂
Anonymous
Not applicable
Author

Hi Sunny,

I'm not a SQL Guru, just got a lot of practice, mostly (but not only) because of QlikView.  One time used to work with Sybase a lot, and they had very good online help.  Just keep in mind that SQL is not the same between different databases.  For example, the above syntax is not going to work with Oracle.

Regards,

Michael

sunny_talwar

I was actually referring to SQL within QlikView only. Cause I have worked with SQL previously and I understand some of the syntax, but wanted to know what all SQL syntax-es can be used within QlikView?

Best,

Sunny

Anonymous
Not applicable
Author

I see...  QlikView doesn't have its own SQL.  As soon as you have SELECT or SQL SELECT (or SQL <anything>) - it is the SQL of the database you're reading from (or even writing to, if allowed).  If it works with the database directly, it works within QV as well.

rustyfishbones
Master II
Master II

I never realised that Michael

Thanks for sharing

Alan

Anonymous
Not applicable
Author

Now you know

A recent situation.  I had to update a table in a test database in MS SQL Server.  Didn't have a MS SQL client installed in that environment but had QV desktop.  So, I wrote a script like SQL UPDATE... in QV.  Ran it, and got what I needed.

WARNING: Don't try it at home!