Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
satishkurra
Valued Contributor II

Join condition syntax error

     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);

6 Replies
MVP
MVP

Re: Join condition syntax error

which error do you get?

maybe the WHERE? is it a variable?

'$(WHERE)';



or a missing space here

year([OrderDate])as

satishkurra
Valued Contributor II

Re: Join condition syntax error

Hi

Please find attached the screen shot for error and script i'm using

You are correct For Where i'm passing variable....

satishkurra
Valued Contributor II

Re: Join condition syntax error

Any update guys....

Employee
Employee

Re: Join condition syntax error

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 ?

MVP
MVP

Re: Join condition syntax error

you can try

- first without where; does it works?

- if yes without the date, does it works

to identify the wrong part

MVP
MVP

Re: Join condition syntax error

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# ..........  ) 

;

Community Browser