You are here: Re: How to extract Hour, Minute & Second « PHP SQL « IT news, forums, messages
Re: How to extract Hour, Minute & Second

Posted by Rik on 01/21/07 16:40

Dale wrote:
> "Paul Lautman" <paul.lautman@btinternet.com> wrote in message
> news:51h5q7F1ipb3iU1@mid.individual.net...
>> Dale wrote:
>>> A table has a field containing the date and time. Example 2006-2-20
>>> 08:11:44.123...field name is DateInitiated. I can extract the month,
>>> day and year by using Day(DateInitiated), Month(DateInitiated),
>>> Year(DateInitiated). How would the time be extracted for hours,
>>> minutes and seconds?
>>> Thanks!
>>
>> Would you believe HOUR() MINUTE() SECOND, or is that too obvious!
>
> Well Paul, I did try that and here's the message that comes back...
>
> Server: Msg 195, Level 15, State 10, Line 1
> 'Hour' is not a recognized function name.

Please don't toppost.

't would be in MySQL, I only just see you probably use MSSQL. Can you
please confirm this?

In that case, this is probably the answer:
http://doc.ddart.net/mssql/sql70/da-db_8.htm

So, DATEPART('hh',DateInitiated).
--
Rik Wasmus

 

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

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