Re: Counting the Dates



Webbiz wrote:

In other words, if I have 10 years of data and my data file starts
with March 3rd 1997, I start by placing the value for March 3rd in an
array element, then the 4th, 5th, etc. When I get back to March 3rd
of the next year, this is added to the first March 3rd value and
stored in the same element number of the array.


I wonder what you are up to. It occurs to me that summing March 3rd data
over 10 years may not mean a lot, if it is business related data. Is
this about stock prices, like your earlier project? Some years, March
3rd will be a Sunday. Holidays are often moved to the nearest Monday, a
different date year to year.

If you are after what I think you are after, it might make more sense to
look at week number and day of week. I would think data on the 10th
Monday, 10th Tuesday, and 10th Wednesday of the year might be more
meaningful, say, than data for the 3rd of March, 4th of March, and 5th
of March.

The DatePart function can return week number, using interval "ww". It
has some options on which week to count as the first week, depending on
where Jan 1 falls. Using default settings, Dec 31 2000 comes back as
week #54, which I assume is the highest it can go. Then you can use "w"
to get the weekday as a number, or use the WeekDay() function.

A 54 x 7 two dimensional array might work out nicely, similar to what
Robert M suggested using months and dates.





.



Relevant Pages

  • Re: Base64-Encoding
    ... -- Pad input data to 3-Byte boundary. ... -- Overlay array of six-bit tokens over the padded input data. ... You're hoping for a representation of an array of 6-bit integers, ... the second array element is such that the two high ...
    (comp.lang.ada)
  • Re: Bugs at my web site
    ... "7.2.1.1.1 Array Element Successor Function and Value of a Subscript. ...
    (comp.lang.fortran)
  • Counting the Dates
    ... So you start reading the data file, adding up all the values that fall on ... When done, you should have an array that has the total value for January 1, ... (In case I'm not making sense: I want to add up all the values found under ... January 1 of each year and place them in the first array element. ...
    (microsoft.public.vb.general.discussion)
  • Re: An inefficiency in Array.Sort
    ... You are failing to appreciate the distinction I am trying to make between comparison of two array elelements and the comparison of two values. ... A comparison of an array element to itself - comparing ato aas you put it - would clearly be inefficient, as the routine should know that the i values were equal and therefore there is no need to use the icomparer. ... These comparisons are common to most sorting routines, either because of the use of temporaries or because the sort operation itself renders comparisons of the i value meaningless. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: INTERFACE problem
    ... meant to include passing an array element to an array dummy, and passing arrays with different rank than the dummy, both of which are somewhat unusual.... ... exclude the case with an INTERFACE, but just to be sure that all the old rules still apply in the no INTERFACE case. ... I don't believe that one implied the other, but yes, both depend on sequence association. ...
    (comp.lang.fortran)

Loading