Reply to Re: Format a datetime columns output?

Your name:

Reply:


Posted by CK on 06/07/06 22:44

"Erland Sommarskog" <esquel@sommarskog.se> wrote in message
news:Xns97DBEF917A66FYazorman@127.0.0.1...
> CK (c_kettenbach@hotmail.com) writes:
>> Currently the query returns 2006-03-27 00:00:00, can I make it output
>> 03/27/2006, I want to truncate the time, and replace the hyphens with
>> forward slashes. Any ideas?
>
> To add to David's reply, if you are using Query Analyzer for output,
> you can change how dates are formatted under Tools->Options->Connections.
> Check "Use Regional Settings...".
>
> You can also do it in an SQL query, look up CASE and CONVERT in Books
> Online. But this is a really poor alternative. Date formatting should
> be handled by the client, so that the user's regional settings can be
> respected.
>

I used , Convert(varchar(25), L.FromDate, 101) AS FromDate in the View and
then CAST(FromDate AS DateTime)>= '03/27/2004' in the query. This is an
internal application but I see why it should be done in code. Thanks!

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

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