<% Dim orderStartDate, orderEndDate orderStartDate = request.querystring("startdate") orderEndDate = request.querystring("enddate") 'DECLARE AND SET VARIABLES if orderStartDate = "" then %>
 Store Shipping Report
SEARCH DATES
Through  (MM/DD/YYYY)
<% elseif orderStartDate <> "" AND orderEndDate <> "" then Dim SQL, rs, vShipCharge, vShipTotal, vShipCount 'SET SQL STATEMENT 'SQL = "SELECT Products.BandName, categories.CatDesc, Products.Name, OrderItems.Price, OrderItems.QTY, Products.ImageURL FROM orders INNER JOIN (categories INNER JOIN (Products INNER JOIN OrderItems ON Products.ProductID = OrderItems.ProductID) ON categories.CatID = Products.CatID) ON orders.OrderID = OrderItems.OrderID WHERE (((orders.ShippedDate)>=#"& orderStartDate & "# And (orders.ShippedDate)<=#"& orderEndDate & "#)) ORDER BY Products.BandName, categories.CatDesc, Products.Name, OrderItems.Price;" SQL = "SELECT Orders.ShipCharge AS ShipCharge FROM orders WHERE (((orders.ShippedDate)>='"& orderStartDate &"') And ((orders.ShippedDate)<='"& orderEndDate &"')) ORDER BY orders.ShippedDate;" 'EXECTURE SQL STATEMENT Set rs = dbc.Execute(SQL) %>    Store Shipping Report   ::   <%=orderStartDate%> - <%=orderEndDate%>

<% While Not rs.EOF vShipCount = vShipCount + 1 vShipTotal = vShipTotal + rs("ShipCharge") rs.moveNext wend %>

TOTAL ORDERS >>  <%=vShipCount%>GRAND TOTAL >>  <%=FormatCurrency(vShipTotal,2)%>

<%else%>
 Please fill in both fields
 Store Shipping Report
SEARCH DATES
Through  (MM/DD/YYYY)
<%end if%>