How to find a day of a date.

  • Hi,

    I got a date say '15-may-2008' (Thursday) and i want to get which day it is?

    Like i need to find that it is Thursday using SQL.

    Thanks.

    "I Love Walking In The Rain So No One Can See Me Crying ! " ~ Charlie Chaplin

  • jchandramouli (12/26/2008)


    Hi,

    I got a date say '15-may-2008' (Thursday) and i want to get which day it is?

    Like i need to find that it is Thursday using SQL.

    Thanks.

    SELECT DATENAME(weekday,date_col) from table


    Madhivanan

    Failing to plan is Planning to fail

  • or if you want to see also the date with dayname you can do like this:

    SELECT DATENAME(weekday,Date_col) + ' ' + CONVERT(VARCHAR, Date_col, 103)

    FROM Your_Table

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Select DATENAME(weekday, YourDateHere)

  • emailtoDeepa (12/29/2008)


    Select DATENAME(weekday, YourDateHere)

    Already suggested


    Madhivanan

    Failing to plan is Planning to fail

  • You can use function.

    { fn week (your date) }

    examples:

    fn week

    fn dayname

    fn monthname

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply