Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
is it possible to insert today() function into an sql select. For example:
sql select field1, field2, year from table1 where year < year(today());
I always get an error
Thanks for your help
Gr.
try using GETDATE()
Try year(getdate()) instead.
Thanks very much. Is it right just for SQL SERVER or is it proper for ORACLE too ?
Gr.
i'm using microsoft sql server. not sure if it is the correct syntax for oracle.
The GetDate() function is definitely the right answer in this case as suggested above.
However in some cases it may be needed to pass values from qlikview script to an sql statement.
Here's an example (something I've already used):
let vField1 = Peek('SystemField1',0,'RelatedTableFields');
let vField2 = Peek('SystemField2',0,'RelatedTableFields');
PropertyValues:
LOAD $(vField1), $(vField2);
SQL SELECT DISTINCT $(vField1), $(vField2) FROM $(vTableName);
Hope this will prove useful in future situations
Hi, for Oracle, try this:
sql select field1, field2, year from table1 where year < to_char(sysdate,'YYYY');
I hope that helps you.
Regards.
Zak