Jump to content
Server Maintenance This Week. ×

Date Calculation


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

Recommended Posts

Can someone help me with a date calcualtion?

I am trying to figure out how to get a result for "Number of days an order is in house" but I want the calculation to factor out weekends so if the order comes in on Friday and goes out on Monday it does not show in house of 3 days.

All I currenty have is: Date_Out - Date_in = Number of days in house. Obvioulsy this won;t work and if I enter an IN_date and no out date I get a return of -732067 until I enter the Out date. There has to be a better way!

Any help would be greatly appreciated.

Thanks,

Steve

Link to comment
Share on other sites

Thanks, I already figured that part out, I am now continuing to try and figure out the "leave out the weekend days" portion but still no luck.

I have always wondered why FileMaker doesn;t include a "check box" or some other method that states "if one or more fields in caclulation is empty do not evaluate."? I'm sure there is a god reason though.

Steve

Edited by Guest
Link to comment
Share on other sites

This works for me:

Div((Date_Out-Date_In); 7) * 5 +

Mod(Date_Out-Date_In; 7 )-

Case( DayOfWeek(Date_Out) < DayOfWeek(Date_In);2;0)

But now I can't figure out how to get the "case" statement to work properly because if I don't have my "date_out" field populated (and this is a field I fill out "after the fact") I get a return of -xxxxxx (number depends on date_in.)

I did have that portion of it working properly until I added/changed to the above.

Fields =:B

date_in: date field

date_out: date field

days_in_house: Number: auto-enter Calculation replaces existing value.

Anybody able to offer any help?

thanks,

Steve

Link to comment
Share on other sites

This Seems to work, Thanks for the help getting me here.

If (IsEmpty(Date_Out) ; " " ; Div((Date_Out-Date_In); 7) * 5 + Mod(Date_Out-Date_In; 7)- Case( DayOfWeek(Date_Out) < DayOfWeek(Date_In);2;0) )

I'm so happy!

Steve

Link to comment
Share on other sites

This topic is 6566 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.