Discussions

 View Only
  • 1.  ToDays does not behave as shown

    Posted 03-10-2019 15:16
    I cannot get ToDays to work for the life of me.  All of the examples I see include a - or Minus sign, but the formula rejects this.

    What QB says:
    "Example: ToDays([Start Date] - Today()) returns the number of days until the Start date."

    But the field errors off and says the operator cannot be used on date time fields.  If I change it to a comma, this error goes away but then it doesn't like either or of the fields.

    Error: "Expecting Duration but found date"

    Why does it want a duration?  I want the number of days between two dates, so giving it a duration makes no sense.


  • 2.  RE: ToDays does not behave as shown

    Posted 03-10-2019 15:26
    The ToDays function expects to see a calculation that involves date fields and nit date/time field types .  It sounds like your field(s) are in fact a date / time field type.  So you could either need to change that field type to be a date field type or else change the formula to

    Todays((ToDate([Start Date]) - Today())

     If you post your actual formula I can help further.





  • 3.  RE: ToDays does not behave as shown

    Posted 03-10-2019 15:41
    Alright, I ended up realizing that you can use the minus sign if you change the field type to Formula Duration.  Now it works perfectly.

    So what is ToDays for?


  • 4.  RE: ToDays does not behave as shown

    Posted 03-10-2019 16:35
    ToDays concerts a Duration type result to numerical field type of of days.

    A duration field type has the concept of the elapsing of time but often when you were trying to use it in formulas you might want that converted to a numeric field and have it converted say to the number of seconds, minutes, hours, days, or weeks. The concept of a Duration field doesn�t inherently have a natural unit of measure, it is just a sense of the elapsing of time.