Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to QlikView and am trying to pull data in from a SQL server, but want to be able to exlude certain data. Here is the code that i have so far, but for some reason it does not like my "WHERE" syntax. Any help would be greatly appreciated.
ODBC CONNECT32 TO Commercial_Planning;
SQL SELECT*
FROM "TM".dbo."TM_t_SD",
WHERE "SD_U_R_I" <> 396427820, OR "SD_U_R_I" <> 396426860;
Hi Patrick,
I only would exclude the data if the amount is huge and you are really sure that you will never need this data.
If you are not 120% sure that you need it or not, you probably should load it all and use a flag field to mark (ir-) relevant data.
Hope it helps and best Regards,
Peter
this is not a Qlikview problem; it's a SQL problem: if you try with some sql tools (SqlServer Management Studio, ....) you'll get the same
to fix it I think
- remova comma
- replace OR with AND (I suppose you don't want 396427820 and 396426860)
ODBC CONNECT32 TO Commercial_Planning;
SQL SELECT*
FROM "TM".dbo."TM_t_SD"
WHERE "SD_U_R_I" <> 396427820 AND "SD_U_R_I" <> 396426860;
In addition to the other suggestions, if you are getting a syntax error it may be that that your values are char fields in which case you should include them in single quotes:
'396427820'
-Rob
Hi
You don't say what your ODBC source is, but if you have a tool to develop queries (eg Toad or MSSQL Management Studio), develop and test the queries there, then paste them into your script with a SQL prefix. QV passes the text after SQL verbatim to the ODBC provider.
This way you can be sure that the query is working and returning the data you expect before adding to your QV script.
HTH
Jonathan