Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

One more question on SQL code

Hi,

I would jsut like to ask:

Is this a valid SQL_statement in Qlikview?

>>> WHERE   END_TIME <= Time(Frac(Now()), 'hh:mm')  <<

(I want to load from a database table all records from today (there is another filter for that) and up to the ReloadTime (I could alternatively place it in the preceding LOAD, but it would be more elegant to just not load any unwanted records from the database instead of dropping them afterwards.

Also, as the report is supposed to run every 10min, keeping the SQL_SELECT to the absolute minimum is crucial.

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like:

WHERE Class not In ('A' , 'S') ;

View solution in original post

4 Replies
tresesco
MVP
MVP

Try like:

WHERE   END_TIME <= Timepart(Now())

datanibbler
Champion
Champion
Author

Thanks tresesco!

One more: I want to use WHERE-clauses to exclude two values: Like

>> WHERE Class <> "A" and Class <> "S" <<

That should be valid - but I know that there can be significant differences in performance, depending on how a query is formulated. Is there a better way to write this? - I cannot "turn it around" and filter for only the values I want, I don't know what those values are/ can be and there might be more going forward.

Thanks a lot!

Best regards,

DataNibbler

tresesco
MVP
MVP

May be like:

WHERE Class not In ('A' , 'S') ;

datanibbler
Champion
Champion
Author


Thanks!

I was aware of this >In< - in general - but not in this context. I have never done much work with SQL.

Best regards,

DataNibbler

P.S.: Is there any specific source (book, website or whatever) that you can recommend rgd. SQL in QlikView?

There are plenty of SQL sites, but I'm always sceptical as there are so many variations of SQL...