I want to get Output has 0 in place of NULL Value
This is the Store Proc
select * from GRPS.dbo.PEChartData
select cast(max(PB12m) as decimal(10,2)) as MaxData , cast( min(PB12m)as decimal(10,2)) as MinData from GRPS.dbo.PEChartData
where convert(datetime,[Price Date],102) > DATEADD(year ,-@iNoYr,GETDATE())
and Code=@code
output-
MaxData MinData
NULL NULL
What I have tried:
SELECT ISNULL(myColumn, 0 ) FROM myTable
SELECT ISNULL(cast(max(PB12m) as decimal(10,2)) as MaxData , 0 ) FROM GRPS.dbo.PEChartData
But this is getting Error
Incorrect syntax near the keyword 'as'.
Kindly help