Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Formula not working
Tagged: Calculation, formula
- This topic has 4 replies, 2 voices, and was last updated 1 week ago by Mike Guilbault.
-
AuthorPosts
-
December 12, 2024 at 2:47 PM #51366
Mike GuilbaultParticipantI have a calculated field and can’t seem to get the formula quite right. It’s to calculate if an order is overdue by establishing if the order has been out for greater than 7 days. If the date Received is filled in, it does not have to calculate and displays nothing “”, but if it’s been out over the 7 days, it’s supposed to display “OVERDUE”.
IFNOTEMPTY([RECEIVED];””;(IF((TODAY()-[DATEOUT]>7);”OVERDUE”;””)))
It works if I only use IF((TODAY()-[DATEOUT]>7);”OVERDUE”;””) – but then if the item is RECEIVED, and it’s over the 7 days, it’s still displaying the OVERDUE – and of course it isn’t.
Any suggestions? the square [ ] brackets are only to indicate the fields used.
- This topic was modified 1 week, 1 day ago by Mike Guilbault.
December 13, 2024 at 12:32 AM #51374
BrendanKeymasterWhat is the data type of the DATEOUT field? Also, the TODAY() function will return the number of seconds since January 1, 1960. If DATEOUT is a Date field, then it also returns the number of seconds since January 1, 1960 to the date specified in that field’s value.
So you’re subtracting seconds. You’ll want to convert those units to days instead. Or just use the DAYS() function, which does that for you.
IFNOTEMPTY([RECEIVED]; "" ; IF(DAYS(TODAY(); [DATEOUT]) > 7); "OVERDUE"; ""))
December 13, 2024 at 9:08 AM #51379
Mike GuilbaultParticipantThanks… that makes sense.. but I must be missing something – Can I assume that spaces don’t make a difference?
IFNOTEMPTY([RECEIVED]; “” ;IF(DAYS(TODAY(); [DATEOUT]) > 7; “OVERDUE”;””))
Didn’t return anything. I closed the doc, reopened, and for some reason, the [RECEIVED] field was filled in with yesterday’s date, which makes sense that OVERDUE isn’t displayed – but why is it filling in? I delete the date, refresh, and it fills in again.
I added a new test record with no RECEIVED date (and more than 7 days after the DATEOUT) but still no OVERDUE.
December 13, 2024 at 1:46 PM #51382
BrendanKeymasterDo you have the Result Type set to be Text? (sorry, haven’t had a chance to look at your file yet).
December 13, 2024 at 1:50 PM #51384
Mike GuilbaultParticipantYes I do.
-
AuthorPosts
You must be logged in to reply to this topic.