Hi all,
Getdate() fuction always returns value in 'yyyy-mm-dd hh:mi:ss.mmm' format
How do i customize this format?
For example i want the value like 'ddmonyyyy hh:mm'
Help required.
Thanx in anticipation.
'yyyy-mm-dd hh:mi:ss.mmm' is the way it is displayed in Query Analyzer. If
you want to have your datetime displayed differently, you have to use
CONVERT. CONVERT supports a number of formats, although it doesn't support
the one you want directly, but you can use REPLACE to remove spaces and LEFT
to remove any characters at the end you don't want.
Jacco Schalkwijk
SQL Server MVP
"Senthil" <anonymous@.discussions.microsoft.com> wrote in message
news:3CAFB558-6D38-4B09-BCA3-646F911D2C44@.microsoft.com...
> Hi all,
> Getdate() fuction always returns value in 'yyyy-mm-dd hh:mi:ss.mmm'
format
> How do i customize this format?
> For example i want the value like 'ddmonyyyy hh:mm'
> Help required.
> Thanx in anticipation.
|||You can also use function DATEPART() to retrieve parts of
date, and append them to get the format you require.
Shrikant Patil
MCDBA
>--Original Message--
> Hi all,
> Getdate() fuction always returns value in 'yyyy-mm-dd
hh:mi:ss.mmm' format
> How do i customize this format?
> For example i want the value like 'ddmonyyyy hh:mm'
> Help required.
> Thanx in anticipation.
>.
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment