• Venkatesan Prabu (6/6/2010)


    drop table sample_table

    create table sample_table (id int, dat datetime)

    insert into sample_table values(1,getdate())

    select * from sample_table

    select id,dat from sample_table where datename(month,dat)='June'

    -----------------------------------------

    id dat

    -----------------------------------------

    1 2010-06-07 10:54:52.607

    -----------------------------------------

    Cheers,

    Venkatesan Prabu .J

    http://venkattechnicalblog.blogspot.com/

    Ummm... I don't get it. How does that deal with the original request of converting month numbers to month names?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)