Home > Archive > MS SQL Server > June 2005 > Help :Custom Date Time Format









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help :Custom Date Time Format
Robert Lie

2005-06-24, 3:23 am

Dear All,

How to return current time in format as below:
YYYYMMDDHHMM -> Year-Month-Date-Hour-Minute

Thanks

Robert Lie
Jens Süßmeyer

2005-06-24, 3:23 am

Best thing would be to write a UDF and put in some standardformat to get the
special format you need.

HTH, Jens Suessmeyer.

"Robert Lie" <robert.lie24@gmail.com> schrieb im Newsbeitrag
news:O9BRSXJeFHA.3864@TK2MSFTNGP10.phx.gbl...
> Dear All,
>
> How to return current time in format as below:
> YYYYMMDDHHMM -> Year-Month-Date-Hour-Minute
>
> Thanks
>
> Robert Lie



Herbert

2005-06-24, 7:23 am

Hi,

Use this format
select Convert(Varchar,getd
ate(),120)

Hope this will help

Herbert


"Robert Lie" wrote:

> Dear All,
>
> How to return current time in format as below:
> YYYYMMDDHHMM -> Year-Month-Date-Hour-Minute
>
> Thanks
>
> Robert Lie
>

Dan Guzman

2005-06-24, 7:23 am

To add to the other responses, consider performing data formatting in your
presentation layer rather than Transact-SQL. SQL Server is optimized for
efficient data access and application code/reporting tools generally provide
more robust and efficient formatting capabilities.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Robert Lie" <robert.lie24@gmail.com> wrote in message
news:O9BRSXJeFHA.3864@TK2MSFTNGP10.phx.gbl...
> Dear All,
>
> How to return current time in format as below:
> YYYYMMDDHHMM -> Year-Month-Date-Hour-Minute
>
> Thanks
>
> Robert Lie



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com