Adding a Date field in Epicor

We created a BAQ to help with scheduling and were wondering if there was a way to take a date field and subtract business days from it?

To clarify, we have a “required by” date and our standard “start by” dates are 3, 6, 9 days before the required date based on the size of the job. Is there any way to add a calculated field in a BAQ to do that for us? We already have a calculated field to figure out the days of production (3,6,9).

This is a tricky ask, but it has been done before. Check out this post for some ideas to try.
Calculate working days between to dates - ERP 10 - Epicor User Help Forum (
Good luck!

Thank you! I’ll take a look.

@dpassenant If you profile is correct and you are 9 that does not apply to you. In the BAQ code KB below there is a section on getting date differences and that you have to convert them to integers. Below is some example ABL that subtracts the dates and then removes weekends. It does not take out holidays.

BAQ Code Library.p (15.6 KB)

If 	Integer(ttJobHead.Date07) > 0  and ttJobHead.Number11 > 0 and ttJobHead.Number11 < 5 Then Do:
							Assign JobMtl.WIReqDate = ttJobHead.Date07 - ttJobHead.Number11.
							Assign Loop = Integer(ttJobHead.Date07) - Integer(ttJobHead.Number11).
					Else do.
					Assign JobMtl.WIReqDate = JobMtl.ReqDate - WIDiff.
					Assign Loop = Integer(ttJobHead.Date07) - Integer(JobMtl.WIReqDate).
				  Do i = 1 to Loop.
				  	If Weekday(JobMtl.WIReqDate + i) = 1 or Weekday(JobMtl.WIReqDate + i) = 7 Then
				  		addDay = addDay + 1.
				  JobMtl.WIReqDate = JobMtl.WIReqDate - addDay.
					If Weekday(JobMtl.WIReqDate) = 1 Then JobMtl.WIReqDate = JobMtl.WIReqDate - 2.
					If Weekday(JobMtl.WIReqDate) = 7 Then JobMtl.WIReqDate = JobMtl.WIReqDate - 1.