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

Bad Date format

Hi All,

I have created a Crystal Report on a BEx query. The data format setup in user's BW system varies between MM/DD/YYYY and MM.DD.YYYY. The Report works fine if the received date format is MM/DD/YYYY, but fails with error message Bad Date format if the received date format is DD.MM.YYYY.

Please let me know if there is a way that can allow Crystal Report to accept Date from BEx in either format. An early response will be appreciated.

Thanks & regards,

Manu.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 20, 2010 at 08:20 PM

    You might want to use cDate() function to change the date format...

    Cdate({field.Date}, "MM/DD/YYY")

    Hope this helps!!!

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the reply.

      I have already tried using CDATE. I need to read multiple date formats which come in from BEx as a String.

      Any other suggestions that I can try out will be appreciated.

      Thanks,

      Manu.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2010 at 09:26 AM

    You need some sort of flag to identify when format changes, at present formula fails when it see MM greater than 12

    however dates where day is less than 13 will be accepted but prcessed incorrectly.

    ie 03/04/2010 3rd April UK format will be processed as 4th March US format.

    If there is no format flag then I suggest you shoot your DBA for allowing mixed date formats!

    Assuming there is a flag you can create a date formula

    @Date

    If Flag = x then cdate(datefield, 'MM/DD/YYYY' else cdate(datefield, 'DD/MM/YYYY'

    Ian

    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.