Date conversion to CCYYMMDD

  • thanks for the help, I did eventually find this in BOL. I'm just having trouble putting the syntax together. I'm new to T-SQL and waiting for some reference materials to arrive. Any good reference book suggestions would be greatly appreciated.

    convert(char(8),empper.birth_date,112) 

  • Assuming that the column holding your dates is a datetime datatype, you can convert it to a string and use a style parameter.

    SELECT CONVERT(CHAR(8), myDateColumn, 112) FROM ....

    ..will probably do the trick.

    Also, you can read more about display styles for dates under the subject CONVERT in BOL.

    /Kenneth

Viewing 2 posts - 1 through 1 (of 1 total)

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