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.
I'm working on a different SQL Statement since I'm trying to load a table using an SQL Statement where the source is an SQL Server Database. So the steps are:
After clicking on OK:
Here is the script:
SELECT [Active All Policies].[Counted as a Sale],
IFF (([Active All Policies].[Policy Type]='RN' & [Active All Policies].[Start Date]<TODAY() & [Active All Policies].[Counted as a Sale]='False'), "Yes",
IFF (([Active All Policies].[Policy Type]='NB' & [Active All Policies].[Start Date]<TODAY()-14 & [Active All Policies].[Counted as a Sale]='False'), "Yes", "No"))
AS Overdue,
[Active All Policies].[Risk Type], [Active All Policies].[Rating Answer 4], [Active All Policies].[Start Date], [Active All Policies].[Promotion ID],
[Active All Policies].[Signed Proposal Received], [Active All Policies].[Total Premium]
FROM [Active All Policies]
WHERE ([Active All Policies].[Total Premium]-[Active All Policies].[Total Paid]+[Active All Policies].[Write On or Off Amount]<>0 AND ([Active All Policies].[Payment Process]<>'Instalment' And [Active All Policies].[Payment Process]<>'Lump Sum via Broker') AND ([Active All Policies].[Risk Type]='Motor Vehicle' OR [Active All Policies].[Risk Type]='Payment Protection') AND [Active All Policies].[Total Premium]<>0) OR([Active All Policies].[Counted as a Sale]='False' AND ([Active All Policies].[Risk Type]='Motor Vehicle' OR [Active All Policies].[Risk Type]='Payment Protection') AND [Active All Policies].[Start Date]<=TODAY() AND [Active All Policies].[Total Premium]<>0)
ORDER BY [Active All Policies].[Counted as a Sale], [Active All Policies].[Total Premium]-[Active All Policies].[Total Paid]
Any can point out what I did wrong? Thanks in advance
Solved! Go to Solution.
Hi @jarednigel07,
Please change the "Yes", "No" to 'Yes','No' , we should use single quotation marks(' ') instead of double quotation marks (" "). Please test your SQL statement in SQL Server Management studio(SSMS) and confirm it works fine. Then past it to Get data navigator, to check if the error disppears.
Best Regards,
Angelia
Hi @jarednigel07,
As far as I know there is no IFF function in SQL Server (IIF is perhaps what you wanted to use).
Cheers,
Pawel
Thanks for pointing that out @Anonymous. I have changed it already but still getting the same error.
Hi @jarednigel07,
Have you resolved your issue? If you have, please mark the right reply as answer, so more people will benefit from it.
Best Regards,
Angelia
Hi @jarednigel07,
Please change the "Yes", "No" to 'Yes','No' , we should use single quotation marks(' ') instead of double quotation marks (" "). Please test your SQL statement in SQL Server Management studio(SSMS) and confirm it works fine. Then past it to Get data navigator, to check if the error disppears.
Best Regards,
Angelia
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |