Forum Discussion

SuzanneSchaefer's avatar
SuzanneSchaefer
Qrew Trainee
6 years ago

Countdown formula problem

I have a date field that will be some date in the future (field is titled "Publication Date") and I want QB to tell me how many days there are between that future date and today - a countdown. 

I chose a duration formula field and input the following:
ToDays([Publication Date]-Today()) 

It isn't accepted saying "expecting duration but found number"

What am I doing wrong??

2 Replies

  • Hi Suzanne. If you change the field type for your countdown field to formula numeric, your formula should work. It will give you the number of days as a number rather than a duration.

    If you want to keep it as a formula duration, you can make the formula work by wrapping the whole thing in a Days() function:
    Days(ToDays([Publication Date]-Today()))
    Since the field needs to return a value of type duration, the Days() function will convert the numeric value returned by your current formula into a duration value.

    It's tricky, I know. It messes everybody up from time to time.

    Yours truly,

    Phillip


    PHILLIP DENNIS
    Principal | Watkyn LLC
    Quick Base Solution Provider
    (954) 900-6690 | hello@watkyn.com
    www.watkyn.com
    Watkyn LLC