× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Adam West wrote:
HI I have a need to look at a file of back orders, and assume, for the sake of the report, that each back order will be shipped today and the customer will pay by the end of the terms date that they have, e.g. net 10 days, net 30 days etc.

This will then be printed as a report to the week ending day of Friday for that particular week in the future.

Let me try to restate this to make sure I understand. You want to read through all the back orders and print (for example) the total number of orders and total value expected to be paid for each (Friday-ending) week?

One possible solution would be to program something like this:
today = today's date
thisFriday = nextFriday(today)

for each order
payDate = td + payByDays(billedCustomer)
payWeekEnd = nextFriday(payDate)
payWeek = (payWeekEnd - thisFriday) in weeks

totalOrders[payWeek] += 1
totalValue[payWeek] += orderValue

where nextFriday(inputDate) goes something like:
fridayDate = inputDate + ((DAY_FRIDAY - dayOfWeek(inputDate)) in days)

dayOfWeek(inputDate) should return 7 for Friday, 6 for Thursday, 5 for Wednesday, etc.

SQL has a function to return the day of the week, which you could use to implement your dayOfWeek function.

Hope this helps,
Adam

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.