You are here: Re: SQL Convert function!! « MsSQL Server « IT news, forums, messages
Re: SQL Convert function!!

Posted by Steve Kass on 10/07/05 08:45

See what you get from

select PeriodYear, PeriodMonth
from yourTable
where PeriodYear not between '1753' and '9999'
or (PeriodMonth not between '1' and '12'
and PeriodMonth not between '01' and '09')

Steve Kass
Drew University

v0lcan0 wrote:
> I’m trying to cast and integer type to a varchar and then concatenate
> two varchar and ’01’ and convert it into datetime with the following
> code:
>
> CONVERT(datetime, { fn CONCAT({ fn CONCAT(CAST(PeriodYear AS varchar),
> CAST(PeriodMonth AS varchar)) }, ’01’) }, 112) AS date
>
> It gives an error saying syntax error converting datetime from
> character string.
>
> Any help appreciated!!
>
> thx..
>

 

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

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