Syntax error in Join Operation (Runtime Error)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jayesh Patel

    Syntax error in Join Operation (Runtime Error)

    I am trying to run below query in vb6 but i found runtime error like"Syntax error in Join Operation (Runtime Error)"


    Please help.

    Query:
    Code:
    SELECT Sum(Ageing_Master.DAYS_0_30) AS SumOfDAYS_0_30 
    FROM (INPUT_DATA LEFT JOIN Ageing_Master ON INPUT_DATA.ACCT_EXT_ID = Ageing_Master.ACCT_EXT_ID 
    GROUP BY INPUT_DATA.G_Comp HAVING (((INPUT_DATA.G_Comp)=""" & "Anthony" & """)))
    Thanks in Advance.
    Last edited by Atli; Oct 19 '10, 12:18 PM. Reason: Please use [code] tags when posting code.
  • danp129
    Recognized Expert Contributor
    • Jul 2006
    • 323

    #2
    Run your code in a query directly in the database instead of through code. You can get rid of the "(" after FROM and the very last ")". You need single quotes around Anthony in the query passed to the DB, not double quotes. It also looks like you could use WHERE instead of HAVING although HAVING should probably work.

    Comment

    • Jayesh Patel

      #3
      Thanks... I got resolution by my self. it is run and works properly if i write all code in oneline in vb.

      Thank you very much sir for your Revert... Your Site is Very nice.. I got so much correct answer from the same.

      Comment

      Working...