locked
help with mid function and #func! RRS feed

  • Question

  • i have a field that return a strung as "1 year 10 months 12 ,days"

    i need to pull the days 

    i used the function  ,pos: InStrRev([diff],",")

    and   days: Mid([diff],[,pos]-3,2)   (-3 because my language is Right to left)

    now if the result in ",pos" field is 0 than i get #func! error (I need him to give me zero value for a calculating field)

    I have tried many combinations with "iff" And other functions

    BTW i  can remove the "comma" from "days" 

    Wednesday, December 25, 2019 4:39 PM

Answers

  • ok solve it

    days: IIf([,pos]=0,"0",(Mid([diff],[,pos]-3,2)))


    • Marked as answer by eshay1 Wednesday, December 25, 2019 5:56 PM
    • Edited by eshay1 Wednesday, December 25, 2019 5:57 PM
    Wednesday, December 25, 2019 5:56 PM