Discussion Board for collaboration on QlikView Scripting.
I am trying to reduce the data loaded from a table using the date field within it.
To avoid links to other tables using the same field name I have qualified the table but I think this is causing me the issue with my where statement.
Table is named SalesOrderLinesHistory (original table is orddeth)
Field is o-date (so appears as SalesOrderLinesHistory.o-date in the Qlik table view)
Qlik table shows SalesOrderLinesHistory.o-date column is formatted correctly as dd/mm/yyyy
I added WHERE "o-date" >= Date(27/04/2013);
after the FROM PUB.orddeth statement but I get the error:
SQL##f - SqlState: S1000, ErrorCode: 4294757240, ErrorMsg: [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Syntax error in SQL statement at or about "Date(27/04/2013)" (10713)
I added WHERE "o-date" >= 27/04/2013;
SQL##f - SqlState: S1000, ErrorCode: 4294947288, ErrorMsg: [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Inconsistent types (7481)
Have you tried with single quotes like:
WHERE o-date >= '27/04/2013' ; ?
This error is related to the SQL syntax.
You must look at the SQL functions which will convert the text into date and then you can use that in SQL select statement.
Can you elaborate please Kaushik ?
Thanks for tresesco but I still get an error.
I believe the o-date field maybe loaded as text so the criteria may not be working.
use a variable