Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Help needed in below join condition. Throwing syntax error. Please help...
LOAD *,
month([OrderDate]) as OrderMonth,
year([OrderDate])as OrderYear;
SQL SELECT
CustomerID,
Sales_SalesOrderHeader.SalesOrderID as SalesOrderID,
Sales_SalesOrderHeader.SalesPersonID as SalesPersonID,
TerritoryID,
AccountNumber,
OrderDate,
CreditCardApprovalCode,
SubTotal,
TaxAmt,
TotalDue,
ProductID,
OrderQty
FROM Sales_SalesOrderDetail
JOIN Sales_SalesOrderHeader
ON Sales_SalesOrderDetail.SalesOrderID = Sales_SalesOrderHeader.SalesOrderID
$(WHERE);
which error do you get?
maybe the WHERE? is it a variable?
'$(WHERE)';
or a missing space here
year([OrderDate])as
Hi
Please find attached the screen shot for error and script i'm using
You are correct For Where i'm passing variable....
Any update guys....
does the SQL syntax work outside QlikView. I often see 'INNER JOIN' instead of just 'JOIN' in native SQL , but it depends what the driver accepts.
If you remove the join (and extra fields) and just do a from <table> and where <condition> (so remove the join) do you get the error ?
you can try
- first without where; does it works?
- if yes without the date, does it works
to identify the wrong part
MS Access use the Jet Engine which use the hash # for any date literal - so you will have to change the single quotes into hashes - like this:
.......
OrderDate IN ( #2001-07-01 12:00:00 AM# , #2001-07-02 12:00:00 AM# .......... )
;