I have the following query:
SELECT
CASE
WHEN ([DBO].fn_WorkDays(GETDATE(), DATEADD(d, 1, EOMONTH(GETDATE()))) = 2)
THEN 1
END
That should return 1 if the condition is true (obviously), but I want it to return nothing (no rows) if false. Instead, it's returning a null row. How do I force it to return 1 or nothing?
How about
IF [DBO].fn_STRS_WorkDays(GETDATE(), DATEADD(d, 1, EOMONTH(GETDATE()))) = 2
SELECT 1
select * from dbo.table where 1=0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With