Skip to Content
avatar image
Former Member

ToDate function does not work

Hi All,

I have a date field in my incoming data that has the following format: MM-DD-YYYY and is of String dataype.

I have another Date in my report that has the following format: mm/dd/yy and is of Date datatype.

I am trying to get the number of days between these 2 dates by using the DaysBetween function.

However, the first Date gives me an error:

"The expression of sub-expression at position 29 in the DaysBetween function uses an invalid data type. (IES 10037)"

This error is referrring to the data format of the first date and when i try to convert this date using ToDate function, I get a #Error on my report.

Can someone please help me how to fix this issue while trying to get the number of days between the 2 Date fields?

Any help is greatly appreciated.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 30, 2015 at 05:08 PM

    Nimish,

    Whats the todate formula that you are using.

    The formula that needs to be used is ToDate([FirstDate];"MM-dd-yyyy")

    Regards

    Sri Harsha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 04, 2015 at 10:29 PM

    SriHarsha,

    Thank you for your response. Yes, this formula worked for me.

    Add comment
    10|10000 characters needed characters exceeded