Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
Need your help in understanding wherer the syntax is getting wrong, When upload to Power BI SQL server i am getting "Incorrect syntax near ','."
Any ideas.
CLOSED_CASE_DTL AS (
SELECT E.EQUIP_ID,
E.CASE_NUMBER,
E.CASE_TYPE,
E.SUBJECT_REF,
E.SUBJECT_ID,
E.CONTEXT_ID,
E.CASE_SUBTYPE,
E.RECEIVED_DATE,
E.[START_DATE] CASE_START_DATE,
E.END_DATE CASE_END_DATE,
E.[STATUS],PR.REGION_ID REGION,
P.PLAN_NAME,
PR.PLAN_ID,
R.REGION_ID,
S.DESCRIPTION SOURCE,
R.[DESCRIPTION],
E.DELIVERY_SOURCE,
0 AGE,
W.ODSDATABASE,
W.PLANSKEY,
E.END_DATE END_DATE,
E.END_USER USERNAME,
E.END_REASON,
'CLOSED CLAIMS' CLAIMS
from DBO.EQUIP_HEADER E JOIN DBO.CONTEXT C ON E.CONTEXT_ID = C.CONTEXT_ID
JOIN DBO.[PLAN] P ON C.CONTEXT_ID = P.PLAN_ID
JOIN DBO.INS_PLAN_CONTROL PR ON P.PLAN_ID = PR.PLAN_ID
JOIN DBO.REGION R ON PR.REGION_ID = R.REGION_ID
JOIN WAREHOUSETEMP.DBO.VFETCHPLANDETAILS W ON P.PLAN_ID = W.AASPLANCODE
JOIN DBO.STANDARD_CODE S ON E.DELIVERY_SOURCE=S.CODE
JOIN PLN P1 ON P1.PLAN_ID=P.PLAN_ID
JOIN REGION R1 ON R.REGION_ID=R1.REGION_ID
where E.CONTEXT_TYPE='*PLAN'
AND E.CASE_TYPE='CLM_INS'
AND C.CONTEXT_STATUS='A'
AND P.STATUS='A'
AND E.[STATUS] = 'C'
AND S.TYPE='SOURCE'
--AND E.END_DATE BETWEEN @FROMDATE AND @TODATE
AND E.END_DATE >= dateadd(day, datediff(day, 0, getdate()) - 1, 0) and E.END_DATE < getdate()
),
Solved! Go to Solution.
Are you putting this SQL in the Advanced box of the SQL Server connector? Does it work when you remove the CLOSED_CASE_DTL( ) wrapper?
Also, why do some fields have square brackets and most don't?
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Are you putting this SQL in the Advanced box of the SQL Server connector? Does it work when you remove the CLOSED_CASE_DTL( ) wrapper?
Also, why do some fields have square brackets and most don't?
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
104 | |
77 | |
73 | |
50 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |