13
Views
1
Comments
Error in advanced query SQL1: Incorrect syntax near the keyword 'AS'.
Question
Application Type
Reactive

this is my actual query i don't know where is the issue.

SELECT {ISWVendorInvoice}.[Id],Dispatch

FROM {ISWVendorInvoice}

INNER JOIN  (SELECT(COUNT({LITInvoicedetails}.[DispatchNo])  AS Dispatch 

FROM {LITInvoicedetails}

GROUP BY {LITInvoicedetails}.[ISWInvoiceID]))

{LITInvoicedetails} ON {LITInvoicedetails}.[ISWInvoiceID] = {ISWVendorInvoice}.[Id]


thanks and regards

karthick

Hello Karthick Balaji,

The issue is related to your alias. Try the following:

SELECT {ISWVendorInvoice}.[Id], Dispatch.DispatchCount 

FROM {ISWVendorInvoice} 

INNER JOIN (    

                SELECT {LITInvoicedetails}.[ISWInvoiceID], COUNT({LITInvoicedetails}.[DispatchNo]) AS DispatchCount    

                 FROM {LITInvoicedetails}    

                 GROUP BY {LITInvoicedetails}.[ISWInvoiceID] 

) AS Dispatch ON Dispatch.[ISWInvoiceID] = {ISWVendorInvoice}.[Id]; 

Best regards, 

Ana

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.