Hi and thanks for reading this. i have a table that has seasonal rate dates for a particular property, RateStartDate and RateEndDate. The user can assign many seasonal rates and set the date range for each, setting the RateStartDate and RateEndDate. The table also contains day of week columns "Sun", "Mon", ... till "Sat"
The user has the option to set a rate for these days.
For every new seasonal rate date range i'm creating a new xml rate node.
My issue is that i can't seem to visualize how to iterate thru the RateStartDate and RateEndDate to set the rate node
price for the week days that are in the RateStartDate to RateEndDate range.
this is the train of thought i can so far precieve:
The user has the option to set a rate for these days.
For every new seasonal rate date range i'm creating a new xml rate node.
My issue is that i can't seem to visualize how to iterate thru the RateStartDate and RateEndDate to set the rate node
price for the week days that are in the RateStartDate to RateEndDate range.
this is the train of thought i can so far precieve:
Code:
strSQL = "Select * From Rate Where RateGroupID=" & strRateGroupID
Set objRS = DbExecuteReturn(strSQL)
rateNode=" "
If NOT objRS.EOF Then
If objRS("Sun") > 0 Then
Dim rStartDate, rEndDate
Do While objRS("Sun") > 0
rStartDate = WeekdayName(Weekday(objRS("RateStartDate")))
rEndDate = WeekdayName(Weekday(objRS("RateEndDate")))
rateNode = rateNode & encodeXML("<rate start=""" & rStartDate & """ stop=""" & rEndDate & """ price=""" & objRS("RateValue") & """ />")
objRS.MoveNext
Loop
Else
....
End If
Else
...
End If