Skip to Content
author's profile photo Former Member
Former Member

case for different date formats

hi everyone,

i have a question regarding handeling different date formats using ifthenelse:

i have this data flow where i exract from a csv file and one of the columns contain dates

the actual data comes in all sorts of different formats: 'mm/dd/yyyy h:mm:ss' or 'm/dd/yyyy h:mm:ss' 'm/dd/yyyy' or 'mm/dd/yyyy' etc

evetually i want all rows in format: mm/dd/yyyy hh:mm and i dont mind to add 00:00 in case the time is missing

i tried the following command at the columns' mapping:

ifthenelse(time(RESELLER_VERSION.ACTIVE_DATE) is null, RESELLER_VERSION.ACTIVE_DATE || '00:00',to_date(RESELLER_VERSION.ACTIVE_DATE, 'mm/dd/yyyy hh:mm'))

i recieved a validation error..

of course this command supports for now only one case but i think if that will work properly it's a good start

thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2012 at 03:02 PM

    just wanted to point out that at the file format scema the data type of that column is varchar so there shouldn't be a problem with the CONCATENATE

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.