Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

darn dates again

Status
Not open for further replies.

onressy

Programmer
Mar 7, 2006
421
0
0
CA
Hi i always seem to be stuck doing something i'm not good at, yet.
Any suggestions on determining which days (if any) the Discount rate range is in the RateStartDate to RateEndDate range. Dates are in format 2006-09-01

strDiscountStart
strDiscountEnd

RateStartDate
RateEndDate
 
Need more info.

I have read over your question a few times, and i'm still unclear what you are asking. Is the RateStartDate a day or date? Are you given info the discount lasts 4 days? or 10-1-2006 through 10-6-2006? Are you applying this to a output of some sort?
 
I think maybe the question is how to determine if one date range overlaps another separate date range.
 
If so, just convert your strings to dates and loop through using >= start AND <= finish

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
RateStartDate is a date, like 2006-08-27

giving a discount to the duration during the DiscountStart to DiscountEnd

If the range of RateStartDate to RateEndDate is in the DicountDate range then presedence is given to the discoutDate cost for the part that the discount date duration overlaps the RateStartDate to RateEndDate duration
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top