Sirena609 Posted August 8, 2008 Share Posted August 8, 2008 Hello all, I have been trying to figure this out for days and my brain is FRIED, so I am hoping someone can help me. I need to write an if then statement that will set a variable to yes if it is between 3:00pm on a Thursday and 3:00pm on a Friday. (Purpose is to have a Saturday Shipping Option only available if you order between those times). My original plan of attack was to make an If Then that checked the day of the week and would set a day variable (xday) to the day name and then another if then that would see if it was before or after 3:00 then I was going to make another if then to determine if xday = thurs and if xtime = after then offer shipping, and another one that would handle if xday = Fri and if xtime = before then offer shipping.I know there has to be an easier way to do this. Plus, I have the following code to determine day of the week:<%Dim strDayDim strMonthDim xdaystrDay=(weekday(date))Select Case strDaycase 1 Response.write("Sunday")case 2 Response.write("Monday")case 3 Response.write("Tuesday")case 4 Response.write("Wednesday")case 5 Response.write("Thursday")case 6 Response.write("Friday")case 7 Response.write("Saturday")End Select%>But I can't get this statement to set a session variable, only response.write the answer.Any help would be greatly appreciated, I am extremely stuck, so thank you in advance. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 8, 2008 Share Posted August 8, 2008 You can use this to check if the time is between 3pm on thursday and friday: if (Weekday(Now) = 5 and Hour(Now) >= 15) or (Weekday(Now) = 6 and Hour(Now) < 15) then sat_ship = trueelse sat_ship = falseend if This is how you set a session variable:Session("var_name") = value Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.