Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
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

Tags (1)
1 Solution

Accepted Solutions
Highlighted
mov
Esteemed Contributor III

Re: Help with Sql Where Date >

I expect this to work as well:

Sql Select *

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

View solution in original post

9 Replies
Highlighted

Re: Help with Sql Where Date >

Have you tried doing like this maybe:

Table:

LOAD *

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

Sql Select *

FROM dbo.OVA;


Best,

Sunny

Highlighted
mov
Esteemed Contributor III

Re: Help with Sql Where Date >

I expect this to work as well:

Sql Select *

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

View solution in original post

Highlighted

Re: Help with Sql Where Date >

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

Re: Help with Sql Where Date >

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.
Highlighted
mov
Esteemed Contributor III

Re: Help with Sql Where Date >

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

Highlighted

Re: Help with Sql Where Date >

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

Highlighted
mov
Esteemed Contributor III

Re: Help with Sql Where Date >

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.

Highlighted
rustyfishbones
Honored Contributor II

Re: Help with Sql Where Date >

I never realised that Michael

Thanks for sharing

Alan

Highlighted
mov
Esteemed Contributor III

Re: Help with Sql Where Date >

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!