how to get 2 didgit year instead of 4 digit year from Source file

  • Hello All,

    in my source file i have date columns formatted as MM/DD/YYYY how can i get the value as MM/DD/YY(just 2 year digit is fine) in destination file

    Please.,,,

    Thanks in advance

    bujji

  • Do a conversion step that puts it in the format you want. Books Online has the available target formats, under Cast and Convert.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Hello GSquared,

    i applied SUBSTRING([DateString], 1, 6) + SUBSTRING([DateString], 9, 2) it is working fine, given by Todd

    thank you for your valuable response

    Best regards

    bujji.

  • asita (3/10/2009)


    Hello GSquared,

    i applied SUBSTRING([DateString], 1, 6) + SUBSTRING([DateString], 9, 2) it is working fine, given by Todd

    thank you for your valuable response

    Best regards

    bujji.

    That also means that you've learned nothing about date formats for such a thing. You really should go look up the different date formats under CONVERT in Books Online. I'd show you the right way to do it, but you really need to look at Books Online so you know what future possibilities are. 😉

    --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)

Viewing 4 posts - 1 through 3 (of 3 total)

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