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

Posted by v0lcan0 on 10/13/05 03:28

"" wrote:
> 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..
> >

thx for that steve..

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/General-Discussions-SQL-Convert-function-ftopict261333.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=904391

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация