Convert date from mm/dd/yyyy to yyyy-mm-dd

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Convert date from mm/dd/yyyy to yyyy-mm-dd

Post by Marley777 »

Hi, thanks for reading. What's the best way to convert a date from mm/dd/yyyy to yyyy-mm-dd? I tried the forum, but not seeing a specifc option for my situtation. Any help is greatly appreciated.
dsusersaj
Premium Member
Premium Member
Posts: 160
Joined: Mon Dec 17, 2007 10:44 am

Re: Convert date from mm/dd/yyyy to yyyy-mm-dd

Post by dsusersaj »

Extract MM,DD and YYYY from your date and then make a string like YYYY'/'MM'/'DD .Then convert that string to date using StringToDate function.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Neither one of those is a date but rather strings. So either cut it up and put it back together the way you want or go StringToDate() and then DateToString() with the proper format masks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

See the Parallel Job Developer's Guide Chapter 2. Designing parallel jobs. Look under the "Date and time formats" section for all the possible date and time format tags to choose from.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply