You are here: Re: datetime « MsSQL Server « IT news, forums, messages
Re: datetime

Posted by manstein on 12/09/05 00:00

Hello TGEAR

Your column is defined as datetime datatype and you have a default
insert of the getdate() function with is also of datatype datetime
there for your value is not stored in the format '10/12/2004 7:28:02
AM' but instead is similar to: '2004-10-12 07:28:02.000'. I say
similar because it depends on the precision of the milliseconds. What
you need to do is format your where clause value to be compatable with
datetime values:

SELECT auditime
FROM testtable
WHERE convert(varchar(50),auditime,120) = '2004-10-12 07:28:02'

your good to go.

best regards

 

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

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