» Market Data » Historical Data
Historical Data

Market Data » Historical Data (MEX Futures Products)

 
 
<%set dbconn=getDB() Set rsdatedisp=Server.CreateObject("ADODB.Recordset") rsdatedisp.cursortype=3 strSqldatedisp="select convert(varchar(11),max(hist_date),113) as dispdate from historical_data_new where viewstatus=1" rsdatedisp.Open strSqldatedisp,dbconn %> <% Set rs=Server.CreateObject("ADODB.Recordset") rs.cursortype=3 strSqllist="select * from historical_data_new where hist_date='"& rsdatedisp("dispdate") &"' and viewstatus=1 order by item_name asc,item_date asc" rs.Open strSqllist,dbconn if rs.recordcount<>0 then bgcol=1 while not rs.eof%> <%bgcol=bgcol+1 rs.movenext Wend else %> <%end if %>
<% if rsdatedisp.recordcount<>0 then%> <%=rsdatedisp("dispdate")%>  <%end if%>
Item Open High Low Close
<%=rs("item_name")%><%=itemdateformat(rs("item_date"))%> <%=rs("open_val")%> <%=rs("high_val")%> <%=rs("low_val")%> <%=rs("close_val")%>
No Historical data found

 
 
 
<% function itemdateformat(val) dim monthNames(12) monthNames(1)="JAN" monthNames(2)="FEB" monthNames(3)="MAR" monthNames(4)="APR" monthNames(5)="MAY" monthNames(6)="JUN" monthNames(7)="JUL" monthNames(8)="AUG" monthNames(9)="SEP" monthNames(10)="OCT" monthNames(11)="NOV" monthNames(12)="DEC" splitval=split(val,"/") itemdateformat=monthNames(splitval(1))&right(splitval(2),2) End function %>