Friday, February 24, 2012

Format Date into Day Name i.e. Mon, Tue, Wed etc...

Is there a conversion for a date field in SQL to show the day of the
week that day is ? I've looked in help with no luck. I know in excel
for example you can create custom format for a date to 'dddd' and it
displays the Monday, Tuesday etc... Even it the Day number was
returned i.e if Monday = 1 then 1, 2, 3, 4, 5, 6, 7 instead of day
names.

PhilippaSELECT DATENAME(DW,datetimecol)
FROM Sometable

--
David Portas
----
Please reply only to the newsgroup
--

"Philippa" <philippa.speirs@.systemc.com> wrote in message
news:9cf39c04.0310220056.18af3e8c@.posting.google.c om...
> Is there a conversion for a date field in SQL to show the day of the
> week that day is ? I've looked in help with no luck. I know in excel
> for example you can create custom format for a date to 'dddd' and it
> displays the Monday, Tuesday etc... Even it the Day number was
> returned i.e if Monday = 1 then 1, 2, 3, 4, 5, 6, 7 instead of day
> names.
> Philippa|||Thank you, this works like a dream

"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message news:<7OGdnSfVRLrN0AuiRVn-uw@.giganews.com>...
> SELECT DATENAME(DW,datetimecol)
> FROM Sometable
> --
> David Portas
> ----
> Please reply only to the newsgroup
> --
> "Philippa" <philippa.speirs@.systemc.com> wrote in message
> news:9cf39c04.0310220056.18af3e8c@.posting.google.c om...
> > Is there a conversion for a date field in SQL to show the day of the
> > week that day is ? I've looked in help with no luck. I know in excel
> > for example you can create custom format for a date to 'dddd' and it
> > displays the Monday, Tuesday etc... Even it the Day number was
> > returned i.e if Monday = 1 then 1, 2, 3, 4, 5, 6, 7 instead of day
> > names.
> > Philippa

No comments:

Post a Comment