Did anyone apply a successfully where clause on a sql statement in qlikview, does anyone know any documentation on that?
I tried applying a different where clause on a simple numeric field and this format keeps giving me an error
SQL SELECT *
what is your DB?
If you run the script in debug you can see the exact query executed, you can copy and past this query in your SQL Tool and execute it.
You have to check the correct sintax for the query and try to create in the script a similar query.
Usually for the date in query I like to write date in format YYYY-MM-DD.
Luca Jonathan Panetta
ok. If I were you I would try to narrow down the issue.
1) Does this work?
WHERE date(soldon) = today() ;
2) On your load statement try both soldon, date(soldon) and see what date format you get without the where clause. This is to see how date() function converts soldon field. Is that a true date or string field?
3) Depending on the result of no. 2 above, try using similar date values in your WHERE clause and see what happens.
It should be that difficult but think something is missing as I tried the no. 1 step and worked for me. But of course, i'm using DB2 and SQL server databases.
I tried a different ways of querying
I confirmed the format is MM/DD/YYYY
the only way it worked so far was this
Year(soldon) as Year,
Month(soldon) as Month,
Day(soldon) as Day,
SQL SELECT *
This is a guess without having a visual foxpro database to test, but this link provided some ideas....
You may also need to pass in the data as a variable
Select * FROM ORDERS WHERE ORDER_DATE < $(vDate)