DateTimeSpan

Ele
Ele
edited February 11, 2022 in Analytics #1
Hi all¡

I'm trying to use the BIRT function DateTimeSpan.days(startDate, endDate) but I don't know which is the proper format of startDate and endDate.

Any help?

Thenk you all¡

Elena

Comments

  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #2
    Hi Elena,

    Generally, if you are selecting Date fields from the database, you can just use syntax like:

    DateTimeSpan.days(row["ORDERDATE"],row["SHIPPEDDATE"])

    ...but if you are working with String dates and need to do some conversion, then remember that the DateTimeSpan.days method takes Date Objects... like the example below.

    var mydate1 = new Date("11/18/2007");
    var mydate2 = new Date("12/04/2007");
    DateTimeSpan.days(mydate1,mydate2);
    Warning No formatter is installed for the format ipb
  • Ele
    Ele
    edited December 31, 1969 #3
    Thankss¡¡¡¡¡