Forum Discussion

NOELHODGES's avatar
NOELHODGES
Qrew Cadet
2 years ago

DateTime Formula

Hi!

I am trying to make a formula with DateTime fields that says if Date A plus 14 days     is     less than or equal to     Date B then return  "Overnight Shipping     else     return "Normal Shipping"


I am using a text formula field and this is what I have so far

IF(ToTEXT(WeekdayAdd(ToDate([Date A]),+14) <= [Date B], "Overnight Shipping","Normal Shipping"))

It is giving me the error on the <= saying "The operator '<=' can't be applied on types date, datetime. 


Does anyone know how to get past this?

------------------------------
NOEL HODGES
------------------------------

1 Reply

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger
    try this

    IF(ToDate([Date A]) + Days(14)  <= ToDate([Date B]), "Overnight Shipping","Normal Shipping"))

    I assume that you actually want 14 Calendar days and not just counting weekdays M-F.

    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------