» Resources » Market Commentary
Market Commentary

Resources » Market Commentary

<% set dbconn=getDB() 'Latest Comments Set rslat=Server.CreateObject("ADODB.Recordset") rslat.cursortype=3 strSqllat="select *, DATEPART(dw, entrydate) as weak_day from market_comments where delstatus=0 and readstatus=1 and convert(varchar(10),entrydate,101)=(select top 1 convert(varchar(10),entrydate,101) from market_comments order by entrydate desc) order by entrydate desc" rslat.Open strSqllat,dbconn 'Archives Set rs=Server.CreateObject("ADODB.Recordset") rs.cursortype=3 strSql=" select top 10 *, DATEPART(dw, entrydate) as weak_day from market_comments where delstatus=0 and readstatus=1 and convert(varchar(10),entrydate,101)<>(select top 1 convert(varchar(10),entrydate,101) from market_comments order by entrydate desc) order by entrydate desc" rs.Open strSql,dbconn 'Top value Set rstop=Server.CreateObject("ADODB.Recordset") rstop.cursortype=3 strSqltop="select top 1 cno,entrydate from market_comments where readstatus=1 and delstatus=0 order by entrydate desc" rstop.Open strSqltop,dbconn %>
Market Latest Comments
 
Arrow
Latest Market Comments
<% if rslat.recordcount<>0 then bgcol=1 while not rslat.eof %> <%if rslat("comments_by")<>"" then%> <%end if%> <%bgcol=bgcol+1 rslat.movenext Wend %> <% else %> <%end if%>
Market Commentaries
<%=dayformat(rslat("weak_day"))%>, <%=itemdateformat(rslat("entrydate"))%> NPT
"><%=rslat("title")%>
<%=rslat("statement")%>
by, <%=rslat("comments_by")%>
------------------------------
Market Commentry unavailable now





<%if rs.recordcount<>0 then%> Archives
 
Arrow
Market Commentary Archives
<% if rs.recordcount<>0 then bgcol=1 while not rs.eof %> <%if rs("comments_by")<>"" then%> <%end if%> <%bgcol=bgcol+1 rs.movenext Wend %> <% else %> <%end if%>
Recent
<%=dayformat(rs("weak_day"))%>, <%=itemdateformat(rs("entrydate"))%> NPT
"><%=rs("title")%>
<%=rs("statement")%>
by, <%=rs("comments_by")%>
------------------------------
Market Commentry unavailable now
<%end if%>
Total Archives
<% Dim rsyear,sqlyear,rsmonth,sqlmonth,rsday,sqlday,k,dateVal set dbconn=getDB() set rsyear=Server.CreateObject("ADODB.Recordset") rsyear.CursorType=3 sqlyear="select distinct(datepart(yyyy,entrydate)) as row_first from market_comments where readstatus=1 and delstatus=0 order by row_first desc" rsyear.Open sqlyear,dbconn %>
<% k=1 Dim rsyearcnt,sqlyearcnt,rsmonthcnt,sqlmonthcnt,rsdaycnt,sqldaycnt while not rsyear.eof set rsyearcnt=Server.CreateObject("ADODB.Recordset") rsyearcnt.CursorType=3 sqlyearcnt="select count(*) from market_comments where '"& rsyear(0) &"'=datepart(yyyy,entrydate) and readstatus=1 and delstatus=0" rsyearcnt.Open sqlyearcnt,dbconn set rsmonth=Server.CreateObject("ADODB.Recordset") rsmonth.CursorType=3 sqlmonth="select distinct(datepart(mm,entrydate)) as row_first from market_comments where '"& rsyear(0) &"'=datepart(yyyy,entrydate) and readstatus=1 and delstatus=0 order by row_first desc" rsmonth.Open sqlmonth,dbconn %>
<%=rsyear(0)%> (<%=rsyearcnt(0)%>)
<% k=k+1 rsyear.movenext wend %>
Market Commentary View
<% 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,"/") dim dateName dateName = splitval(1) if len(dateName)<=1 then dateName = "0"&dateName end if 'itemdateformat=splitval(1)&" "&monthNames(splitval(0))&" "&right(splitval(2),4) itemdateformat=dateName&" "&monthNames(splitval(0))&", "&splitval(2) End function function dayformat(val) dim dayNames(7) dayNames(1)="Sun" dayNames(2)="Mon" dayNames(3)="Tue" dayNames(4)="Wed" dayNames(5)="Thu" dayNames(6)="Fri" dayNames(7)="Sat" dayformat=dayNames(val) end function Function dateFormatDMY(strVal) Dim spstrVal spstrVal=split(strVal,"/") dateFormatDMY=spstrVal(1)&"/"&spstrVal(0)&"/"&spstrVal(2) End Function %>