You are here: Re: Missing the zero (0) « MsSQL Server « IT news, forums, messages
Re: Missing the zero (0)

Posted by Marko on 12/14/06 07:22

Erland Sommarskog schreef:

> Marko (nortel@planet.nl) writes:
> > I hope someone can help me; if got a value in a cell (040 1234567),
> > when I run a query
> > in the Analyser I got as respons only 40 1234567, so missing the zero
> > (0) not the whole number is displayed. When I run a query on a cell
> > with value 1234567 I received the number 1234567 and that's oke. The
> > Data Type of the Column is Char.
>
> Cell? Do you mean column value in a row? Or are you running a query
> against Excel?
>
> What exact query do you run?
>
> All I can say is that the leading zero should normally not be dropped
> for a character value, which this obviously is, there is a space in it.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>

Hello Erland,

It's a column value in a row, the query I run:

SELECT @Registernum=(
SELECT regnr FROM dbo.planningview
WHERE convert(CHAR(11),date ,106) = convert(CHAR(11),GETDATE(),106)
AND
convert(CHAR(8),Starttime ,108) <= convert(CHAR(8),GETDATE(),108)
AND
convert(CHAR(8),Stoptime ,108) >= convert(CHAR(8),GETDATE(),108) AND

groupName = 'Application' AND shortname = 'Helpdesk' AND deleted =0
)

if (@Registernum is null) Select @Registernum=0
select @Registernum
GO


What I get is 401234567 instaed of 0401234567, so I am missing the 0
(zero).

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация