Discussions

Expand all | Collapse all

IF/Case Statement Issue

  • 1.  IF/Case Statement Issue

    Posted 11-12-2018 20:57
    I have the following fields
    1.  SO TYPE (Multiple Choice)
    2.  DATE FIELDS (Date)
    3.  INITIATION DAYS (Formula Duration)
    4.  INITIATION DAYS RANGES (Formula Duration)

    My Initiation Days formula says the following and is working great!

    If([SO Type]="R" or [SO Type]="LL", ([Portfolio Sent to USACE]-[Sent to QAE]),([Sent NTE Request]-[Date S/O Initiated]))

    I am trying to write the formula for my Initiation Days Ranges formula with the following:

    If([Initiation Days]<19,"0-18",
    If([[Initiation Days]]>18 and [Initiation Days]<38,"19-37"),
    If([Initiation Days]>37 and [Initiation Days]<57,"38-56"),
    "More Than 56 Days")

    But I am getting the following error:

    '<' can't be applied on types duration, number

    Can someone help me figure this out so that I can get this working!!!!!  It is absolutely driving me crazy.


  • 2.  RE: IF/Case Statement Issue

    Posted 11-12-2018 21:08
    try this



    IF(
    [Initiation Days]<days(19),"0-18",
    [Initiation Days]<days(38),"19-37",
    [Initiation Days]<days(57),"38-56",
    "More Than 56 Days")



  • 3.  RE: IF/Case Statement Issue

    Posted 11-12-2018 21:30
    I changed the field type to formula text & the formula you provided worked perfect!  Thank you for your quick response.