hi there
thanks so much for replying.
i found a solution, but its not working a 100%
lets say the user enters 25Feb, the week must start from 25 feb and the next 7 days.
trick is that there are only 28 days in a non-leap year so it must jump from feb to 4 March. i'll show u the leap yr calc ok.
(the part that is commented out doesnt work)
if StrComp(TypeOfReport,"Weekly",0) = 0 then
FromMonth = CInt(request("datemonth"))
FromYear = CInt(request("dateyear"))
FromDay = CInt(request("dateday"))
ToYear = FromYear
ToMonth = FromMonth
ToDay = FromDay + 6
if FromDay = 0 then
FromDay = 1
end if
if FromMonth = 0 then
FromMonth = 1
FromDay = 1
ToDay = FromDay + 6
ToMonth = 1
ToYear = FromYear +1
end if
if ToMonth = 13 then
ToDay = FromDay + 6
ToMonth = 1
ToYear = FromYear + 1
end if
'if (FromYear Mod 4 <> 0) 'and (FromYear Mod 100 <> 0) and (FromYear Mod 400 <>) then
if FromMonth = 2 then
'if FromDay = 29 then
' FromDay = 28
' else FromDay = 29
'end if
if FromDay > 22 then
ToDay = (FromDay + 6) - 28
ToMonth = FromMonth + 1
end if
end if
'elseif FromDay > 23 then
' ToDay = (FromDay + 6) - FromDay
' ToMonth = FromMonth + 1
Thx
Addy