Results 1 to 2 of 2

Thread: I'm looking for some ideas concerning consecutive dates.

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    I'm looking for some ideas concerning consecutive dates.

    Hi,
    I have an application that downloads data through ADO. One of the fields is a "Contract Expiration Date". I place the count of these into monthly buckets.
    My problem is that for some months there is no contracts that are expiring. For example we might have contracts expiring in Jan. 04, Feb. 04, none in May 04, Jun. 04, etc.

    What I'm trying to come up with is a way to tell if I have data for 12 consecutive months, and if not place a 0 (zero) in the monthly bucket with no data.

    Any ideas will be greatly appreciated.

    Thanks,
    Al.
    A computer is a tool, not a toy.

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Try something like this:

    Code:
    dim monthly_bucket(12) as Integer
    Dim i as Variant
    For i = 1 to 12          ' set the buckets all to zero before you do anything else
         monthly_bucket(i) = 0
    Next i
    
    ' play with ADO
    i = Format(MyDate,"mm") 
    monthly_bucket(i) = monthly_bucket(i) + 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width