You are here: Re: forming a string with dateparts « MsSQL Server « IT news, forums, messages
Re: forming a string with dateparts

Posted by Piero 'Giops' Giorgi on 08/30/07 16:12

On Aug 30, 8:31 am, rgintexas <rgarth...@yahoo.com> wrote:
> I want to create a string using the week number and year of a date.
> For instance, if i have a date of 1/3/2007, which would be week 1 of
> 2007, i want to create a string that says 'Wk1-200707'.
> i know it's basically 'WK' + CAST(DATEPART(WK,'1/3/2007') AS VARCHAR)
> + '-' +CAST(DATEPART(YEAR,'1/3/2007') AS VARCHAR) but it's not quite
> working for me. Any idea of what I'm missing?

Besides using the date in the YYYYMMDD format, no.
Works perfectly for me... What's the problem?

P

 

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

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