You are here: Re: WHAT DO I USE TO MAKE A TODAY DATE QUERY? « MsSQL Server « IT news, forums, messages
Re: WHAT DO I USE TO MAKE A TODAY DATE QUERY?

Posted by Erland Sommarskog on 07/22/05 01:56

Ross Presser (rpresser@NOSPAMgmail.com.invalid) writes:
> On Thu, 21 Jul 2005 18:07:49 +0000 (UTC), Erland Sommarskog wrote:
>> Anyway, the best way to strip out the time component is:
>>
>> convert(char(8), getdate(), 112)
>
> that leaves you with a char value. I prefer
>
> convert(datetime, floor(convert(float,getdate())))
>
> even though it's a bit wordier, because it can't possibly be sensitive to
> the region,

Nope. Not format 112, which is YYYYMMDD. This format can only be
interpreted in one single way.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

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

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