Skip to Content
avatar image
Former Member

How to caluculate difference in days between two dates

Hi guys,

Can you please give suggestion how to find out the difference between two dates(difference should be in number of days)

I tryed by the fallowing expression bellow

datediffdatediffdays(Repeater_0.Output{/Row/afd} , Repeater_0.Output{/Row/sfd} )

afd and sfd are two dates.

afd and sfd are Data types of Date

when i Evaluate it was given error in valid date format parameters used as parameters

xMII datasource is MySQL database.

please guide me.

Thanks

Srikanth M

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 23, 2007 at 07:36 PM

    Did you try executing the transaction?

    Probably you will not see this error @ run time as the Dates would have some values.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 23, 2007 at 07:44 PM

    Srikanth,

    Evaluate will not work in this case because it really only has the column knowledge at design time (not the actual row of data that it will have iteratively at runtime).

    The function name in your post looks like a typo (datediffdays is the right name), and if you want to see it work put the expression in a tracer and hit F6.

    With your datasource being a relational database you would have a similar function in sql which is http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html>

    Depending upon your needs you may be better off doing the datediff function in your SQL Query template and not in BLS.

    Regards,

    Jeremy

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 25, 2007 at 03:46 PM

    Try formatting the Repeater_0 values to <b>XML Dates</b> first...as of now they are just <b>strings</b>.

    Add comment
    10|10000 characters needed characters exceeded