Difficult Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is gonna be hard... I'm trying to put together a bill but..
This is the criteria for it..
1. I can only retreve date between two dates ( usualy 3 months )
and
2. Within that time period there can only be so much money billed.

so, if i can only invoice from 3-1-04 to 6-1-04, and only bill $600 between that time, i don't know how to make the query stop when it hits the 6-1-04 mark or the $600 mark and only reflect those records... There are about 50 clients... Think you can figure it out... please let me know

Thanks,
Josh
 
Josh

Instead of using a query, consider writing a procedure that:
opens the recordset for that date range, sorted in date sequence
puts the first record's amt in "total"
compares the total to your limit (?$600) and quits if it's greater than
the limit (maintaining ?what info)
 
Thanks Jeff,

Not sure how to work an equation in VB though. Do you know where i could look to learn about this kind of procedure?

thanks,

Josh
 
Josh

Sorry, I was/am kind of self-taught. I'm sure if you posted in the
modulesdaovba newsgroup and asked, you'd get plenty of suggestions.
 
Josh,

- Are you creating bills for each of the 50 clients, or a single bill?

- What happens to the charges when they reach the $600 figure before the end
of the period? Does the next invoice cover these or do you just take a loss
on those?

-If you reach the $575 mark and the next charge is for $100, do you bill for
the whole $600 and add a record that indicates $75 remaining from the $100
record?

The more I think thru this, the more I think Jeff is probably correct. The
number of conditions and tests associated with this probably make a code
modual the better solution.

Dale

jgspeer said:
This is gonna be hard... I'm trying to put together a bill but..
This is the criteria for it..
1. I can only retreve date between two dates ( usualy 3 months )
and
2. Within that time period there can only be so much money billed.

so, if i can only invoice from 3-1-04 to 6-1-04, and only bill $600
between that time, i don't know how to make the query stop when it hits the
6-1-04 mark or the $600 mark and only reflect those records... There are
about 50 clients... Think you can figure it out... please let me know
 
Back
Top