Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
I'm extracting a field from database with the name Cost Amount (Actual) but it gives me an error in script,
here is my query
SELECT [Cost Amount (Actual)] as prix
FROM [EKG2013].[dbo].[FAD2014$Item Ledger Entry];
regards.
There are many things that may have gone wrong here. But first - if it says that the field name is incorrect, then it is incorrect. So...
One possibility is that you have written the field name with soft blank spaces - char(32) - but it is in fact defined using hard blank spaces - char(160). Another possibility is that the library name is incorrect.
Either way, I would try to load SELECT * FROM ... to see which fields I get.
HIC
is it an oracle db?
SQL SELECT "Cost Amount (Actual)" as prix
FROM [EKG2013].[dbo].[FAD2014$Item Ledger Entry];
no loannis it's an sqlserver database
The SELECT statement is not evaluated by QlikView. It is evaluated by the ODBC driver or OLEDB provider. So, without the error message it is impossible to say what has gone wrong. Perhaps try using double quotes:
SELECT "Cost Amount (Actual)" as prix
FROM [EKG2013].[dbo].[FAD2014$Item Ledger Entry];
HIC
it should work for mssql as well. If you try to select a field with no spaces, does it work?
no either mr henric , it tells me that the field name is incorrect
and for information i use [] and it works for the other queries for fields without parentheses.
no it deosn't 😕
Try using precedent load, something like this:
LOAD
"Cost Amount (Actual)";
SQL SELECT *
FROM [EKG2013].[dbo].[FAD2014$Item Ledger Entry];
There are many things that may have gone wrong here. But first - if it says that the field name is incorrect, then it is incorrect. So...
One possibility is that you have written the field name with soft blank spaces - char(32) - but it is in fact defined using hard blank spaces - char(160). Another possibility is that the library name is incorrect.
Either way, I would try to load SELECT * FROM ... to see which fields I get.
HIC
As Henric and Ioannis, I would have said the double quotes. Double quote and square brackets ? SELECT "[ Your field (xxx)]" as Prix ?
If you are stuck, create a View in SQL Sever with the good name and use it from QlikView
Fabrice