I own a hotel and I need some type of simple booking system I am stuck on this part. Help having problems amending code to affect my hotel booking system I have 4 Prices for LOW, HIGH, Illuminations, BANK HOLIDAY <%response.write(request.form("Day"))%> <%response.write(request.form("Month"))%> <%response.write(request.form("Year"))%> <% ' -- GRAB CODE FEATURE -- strDay = Request.Form("Date") strMonth = Request.Form("Month") strYear = Request.Form("Year") AdultNo = Request.Form("AdultNo") ChildNo = Request.Form("ChildNo") NoNights = Request.Form("NoNights") ' -- Grab Price Based on Month -- Select Case strDay strMonth strYear ' -- Low Season from Jan - April -- Case "1 January 2008 > 30 April 2008" AdultPrice = 25.00 ChildPrice = 11.00 ' -- High Season from May - Aug -- Case "1 May 2008 > 31 August 2008" AdultPrice = 31.50 ChildPrice = 12.50 ' -- Illuminations Season from September - November -- Case "1 September 2008 > 30 November 2008" AdultPrice = 39.88 ChildPrice = 19.99 ' -- Bank Holidays -- ' ---------------------------------------- ' -- (21 March 2008 - 24 March 2008) -- ' -- (3 May 2008 - 5 May 2008) -- ' -- (23 May 2008 - 26 May 2008) -- ' -- (22 August 2008 - 25 August 2008) -- ' ---------------------------------------- Case "21 March 2008 > 24 March 2008" AdultPrice = 49.88 ChildPrice = 29.99 Case "3 May 2008 > 5 May 2008" AdultPrice = 49.88 ChildPrice = 29.99 Case "23 May 2008 > 26 May 2008" AdultPrice = 49.88 ChildPrice = 29.99 Case "23 May 2008 > 26 May 2008" AdultPrice = 49.88 ChildPrice = 29.99 Case "22 August 2008 > 25 August 2008" AdultPrice = 49.88 ChildPrice = 29.99 End Select ' -- Calculate Prices -- intAdultTotal = CDbl(AdultPrice) * (AdultNo) intChildTotal = CDbl(ChildPrice) * (ChildNo) intTotal = CDbl((intAdultTotal + intChildTotal) * NoNights) -------------------------------------------------------------------------------- Code (markup): I want something like this above but cant get it to work ' -- Illuminations Season from September - November -- Case "1 September 2008 > 30 November 2008" AdultPrice = 39.88 ChildPrice = 19.99 Am I doing the wrong code as I keep getting ----------------------------------------------- Microsoft VBScript compilation error '800a03ea' Syntax error /booking/step2.asp, line 54 Case "1 January 2008 > 30 April 2008" ^ -----------------------------------------------
The date comparison is being done as one string, this won't work. You need to type the values as dates, try: Select Case CDate(strDay strMonth strYear) Case CDate("1 January 2008") >= CDate("30 April 2008") AdultPrice = 25.00 ChildPrice = 11.00 bla bla.. Don't forget to include the >= to include the 30th and the 1st in your comparison