× 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:
another thing is I need to have a total owed bucket for each Friday that comes into play.

We've told you a number of ways to get the Friday after a given date. Now that you know how to do that, please read this post* again. I'll describe in words what I'm suggesting with my pseudocode there.

First you figure out the next Friday after today (nextFriday). Next you figure out the Friday due date for the order (payWeekEnd). Now determine the number of weeks between nextFriday and payWeekEnd (payWeek). You can use %diff() or SUBDUR to calculate this value. Now you just need an array with the maximum number of weeks (totalValue). This would be 26 based on your earlier statement the future date could be up to 180 days away. Add each order amount to totalValue[payWeek].

You've been given a bunch of good suggestions so far. Please take the time to read them thoroughly and think about them.

Hope this helps,
Adam

* http://archive.midrange.com/rpg400-l/200811/msg00169.html


I have this to get me my due date
c mydate adddur duedays:*days datedue
but how to then add to correct bucket? Would there be afield that would indicate week1,2 etc of a particular month?

Is this only possible to do in SQL?
If so, how do I do this.

I am willing to code a table of weeks and compare against it but I don't think the dates are the same types.



________________________________
From: Adam Glauser <adamglauser@xxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Sent: Wednesday, November 12, 2008 1:38:34 PM
Subject: Re: date processing for end of week

Adam West wrote:
My question is, how does the program know when the next Friday is?

By figuring out what day of the week today is, then adding the difference between today and Friday.

If you don't want to use SQL, you could implement one of the day of week algorithms* for the Gregorian calendar.

HTH,
Adam

* http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.