The 3rd party SQL interpreter I am running this script via doesn't like the NULLIF the script works fine when ran within SQL Server directly.
select NULLIF(count(*)*100, 0) as Number from vwReg_RMFeedback_Posted where IncidentInvolved = 'Complaint' and (select count(*) from tblDayDates where DayDate between IncidentDate and FBAckDate and DateName(WeekDay,DayDate) not in ('Saturday', 'Sunday')) <= 3and FBAckDate is not null and Site Like '%Bay%'
Is there a way to rewrite this SQL script without the NULLIF?
Any assistance is welcome.
Thank you.
Microsoft SQL ServerSQL
Last Comment
Ryan Chong
8/22/2022 - Mon
Ryan Chong
based on your logic, you can try:
select count(*)*100 as Number from vwReg_RMFeedback_Posted where IncidentInvolved = 'Complaint' and (select count(*) from tblDayDates where DayDate between IncidentDate and FBAckDate and DateName(WeekDay,DayDate) not in ('Saturday', 'Sunday')) <= 3and FBAckDate is not null and Site Like '%Bay%'
Open in new window