Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5854 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I am creating a database for a Landscape contractor business. ( my brother's )

I have Job table with a "date_start_job" field, a "date_end_job" field, and also a "duration_job" calculation field which is ( "date_start_job" - "date_end_job" ) .

There is also a number field called "estimate_duration_job".

What I want to do is have a message appear that shows all jobs which are overdue.

Overdue jobs are jobs where the "date_end job" is bigger than the ("date_start_job" + "estimate_duration_job") but also

where the current date is bigger than ("date_start_job" + "estimate_duration_job")

I created the following calc. but unfortunately it doesn't do the job. My problem is that I can get it to calculate if the "date_end_job" is populated, but if this field is empty it will not calculate. See calculation :

Case ( duration_job > duration_estimate_job ;

"This Job has overrun by " & duration_job - duration_estimate_job & " " & "Days" ;

)

I tried this other calculation and got wrong results as well :)

Case (

IsEmpty ( date_end_job ) ;

and

(date_start_job + duration_estimate_job ;> ( Get ( CurrentDate );

"This Job has overrun by " & duration_job - duration_estimate_job & " " & "Days"

)

) )

Any help is greatly welcomed.

Edited by Guest
Posted (edited)

Try:

Let ( [

end = Case ( date_end_job ; date_end_job ; Get (CurrentDate) ) ;

dur = end - date_start_job

] ;

Case (

dur > duration_estimate_job ;

"This job has overrun by " & dur - duration_estimate_job & " days"

)

)

---

Make sure the calculation is unstored, so that it updates with current date.

Edited by Guest
Posted

Thank you very much for your reply. I am realy gratefull for your help. It worked like a charm.

Posted (edited)

Let ( [

jobDone = NOT IsEmpty ( date_end_job ) ;

daysOver = Case ( jobDone; date_end_job - date_start_job - estimate_duration_job ; Get ( CurrentDate ) - date_start_job - estimate_duration_job )

] ;

Case ( daysOver > 0 ; "This Job " &

Case ( jobDone ; "has overrun " ; "is overrunning " ) & "by " & daysOver & " Day" & Case ( daysOver > 1 ; "s" )

)

)

Edited by Guest
Posted (edited)

That's what happens when I take break before responding! Well, I'm leaving mine, Michael, because yours doesn't display nicely if there is only 1 day. ROFLMAO!!

UPDATE: Oh, and I ditched the calculation of actual duration because I suspected it wasn't necessary by itself and I dislike calcs whose only purpose is to be used in another calc. I might be wrong here however ...

2ND UPDATE: And Michael's calc is prettier in general but I would certainly correct the text portion. :wink2:

Edited by Guest
Added update and then 2nd update
Posted

Thank you for trying to help, but the calc. :

Let ( [

jobDone = NOT IsEmpty ( date_end_job ) ;

daysOver = Case ( jobDone; date_end_job - date_start_job ; Get ( CurrentDate ) - date_start_job - estimate_duration_job )

] ;

Case ( daysOver > 0 ; "This Job " &

Case ( jobDone ; "has overrun " ; "is overrunning " ) & "by " & daysOver & " Day" & Case ( daysOver > 1 ; "s" )

)

)

didn't realy work, because it seems to ignore the end date when this is entered.

Posted (edited)

I had corrected my calc. YOu might check it again. :wink2:

Comment's calc is actually better but I wouldn't want to modify his to include my text result (which I think IS better). :blush2:

Edited by Guest
Posted

I have attached a copy of the DB for you to check is you could. The calc doesn't seem to update.

Thank you for your help.

Posted

No attachment? I'll attach mine. I suspect that you missing this part:

Make sure the calculation is unstored, so that it updates with current date.

I suppose I should have repeated it but when I saw it on his calc, I assumed you understood that, since Get ( CurrentDate ) was in the calculation, it would need to be unstored.

If I'm still missing something, please let us know. :wink2:

Jobs.zip

This topic is 5854 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.