|
-
Sep 9th, 2003, 03:49 PM
#1
Thread Starter
Hyperactive Member
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.
-
Sep 9th, 2003, 04:58 PM
#2
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|