<%@ Language=VBScript %> FusionCharts <% 'Request the current year from querystring Dim intYear, strDataURL intYear = Request("Year") 'Database objects 'oRsYears - Recordset Object 'strSQL - String variable to hold SQL Query (to get all years list) Dim oRsYears, strSQL 'Initialize the recordset object and retrieve the years Set oRsYears = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT DISTINCT YEAR(OrderDate) As Year FROM Orders ORDER BY 1" oRsYears.Open strSQL, DB_CONNECTION 'If no years has been specified select the last one If intYear="" then While not oRsYears.EOF intYear = oRsYears("Year") oRsYears.MoveNext() Wend end if 'Move to first oRsYears.MoveFirst() 'Define dataURL strDataURL = "Data.asp?Year=" & intYear 'URL Encode the dataURL - Important Step strDataURL = Server.URLEncode(strDataURL) %>
FusionCharts
Please select the year for which you want to see the chart:
 

©All Rights Reserved - InfoSoft Global Private Limited - 2005 - www.InfoSoftGlobal.com

<% 'Destroy objects Set oRsYears = nothing %>