Prev: SQL Server 2005 Failure - Logical consistency-based I/O error with
Next: temp_MS_AgentSigningCertificate_database
From: Qaspec on 24 May 2010 08:47 How do i convert "null" values to just show blanks? I'm using the following which returns a "0" value: Isnull (C.DaysInactive, '') as DaysInactive
From: John Bell on 24 May 2010 10:30
On Mon, 24 May 2010 05:47:01 -0700, Qaspec <Qaspec(a)discussions.microsoft.com> wrote: >How do i convert "null" values to just show blanks? I'm using the following >which returns a "0" value: > >Isnull (C.DaysInactive, '') as DaysInactive DaysInactive has an integer datatype and there is an implicit convertion of '' to an integer which gives 0 e.g. DECLARE @intvar int ; DECLARE @strvar varchar(10); DECLARE @datevar datetime; SELECT ISNULL(@intvar,''), CAST('' AS int), ISNULL(@strvar,''), ISNULL(@datevar,''), CAST('' AS datetime) If you convert the column to a character then there will be no conversion SELECT ISNULL(CAsT(@intvar as varchar(18)),'') ISNULL will return the datatype of the first argument, John |