|
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
[Back to original message]
|