Is there any way to make dates come out like "11-oct-07"? There does not
appear to be a built-in format like this. Is there a secret method?
MauryHi
select replace(convert(varchar(20),getdate(),106),' ','-')
"Maury Markowitz" <MauryMarkowitz@.discussions.microsoft.com> wrote in
message news:280EFB54-FE00-4153-A51F-C4D539D8EF12@.microsoft.com...
> Is there any way to make dates come out like "11-oct-07"? There does not
> appear to be a built-in format like this. Is there a secret method?
> Maury|||> select replace(convert(varchar(20),getdate(),106),' ','-')
returns: 11-Oct-2007
select replace(convert(varchar,getdate(),6),' ','-')
returns: 11-Oct-07
see 'convert' in BOL.
>
> "Maury Markowitz" <MauryMarkowitz@.discussions.microsoft.com> wrote in
> message news:280EFB54-FE00-4153-A51F-C4D539D8EF12@.microsoft.com...
>> Is there any way to make dates come out like "11-oct-07"? There does not
>> appear to be a built-in format like this. Is there a secret method?
>> Maury
>|||And to get an exact match to the request ...
select lower(replace(convert(varchar,getdate(),6),' ','-'))
returns: 11-oct-07
>> select replace(convert(varchar(20),getdate(),106),' ','-')
> returns: 11-Oct-2007
> select replace(convert(varchar,getdate(),6),' ','-')
> returns: 11-Oct-07
> see 'convert' in BOL.
>>
>> "Maury Markowitz" <MauryMarkowitz@.discussions.microsoft.com> wrote in
>> message news:280EFB54-FE00-4153-A51F-C4D539D8EF12@.microsoft.com...
>> Is there any way to make dates come out like "11-oct-07"? There does not
>> appear to be a built-in format like this. Is there a secret method?
>> Maury
>>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment