Skip to content
Advertisement

Tag: ssms

how to use NULLIF with aggregate function

I’m using SQL Management Studio 2012. I’m getting a ‘Divide by zero error encountered’ error. I’m aware this requires the use of NULLIF but I’m unsure how to use it in my query. This is my query I’ve actually asked this question before which some kind person answered excellently but that was without the OVER() and SUM aggregate function, I’m

Using ISNULL or COALESCE on date column

I’ve got a date column where some rows have got NULL values. I would like to use ISNULL or something like that to substitute those values with something like ‘N/A’, however, when I try to use ISNULL, I get an error due to two different data types. If I try to convert my Date column to VARCHAR in order to

Advertisement