<%set rsb = Server.CreateObject("ADODB.RECORDSET")
rsb.open "SELECT userBusinessTable.*, businesstable.* FROM businesstable INNER JOIN userBusinessTable ON businesstable.businessID = userBusinessTable.BID WHERE (((userBusinessTable.userpetID)="&rs1("userpetid")&"));",conn
%>
" width="50"> |
"><%=rs1("userpetName")%> |
<%=rs1("companyname")%> |
<%=rsb("businessname")%> |
<%diff = datediff("d",Cdate(rsb("Date_of_Purchase")),Now)
Response.Write(diff)
%> |
<%=rs1("userpetname")%> |
<%set rsbb = Server.CreateObject("ADODB.RECORDSET")
rsbb.open "select count(ubid) as countofb from userbusinesstable where userpetid="&rs1("userpetid"),conn
if not rsbb.eof then
countofbusiness = rsbb("countofb")
Response.Write(rsbb("countofb"))
end if
%> |
<%set rsy=Server.CreateObject("ADODB.RECORDSET")
rsy.open "select sum(monthlyprofit) as yessum from userbusinesstable where userpetid="&rs1("userpetid"),conn
if not rsy.eof then
yesave = cdbl(rsy("yessum")) / countofbusiness
Response.Write(FormatNumber(yesave,2))
end if
%>
|
<%set rsy=Server.CreateObject("ADODB.RECORDSET")
rsy.open "select sum(weeklyprofit) as yessum from userbusinesstable where userpetid="&rs1("userpetid"),conn
if not rsy.eof then
yesave = cdbl(rsy("yessum")) / countofbusiness
Response.Write(FormatNumber(yesave,2))
end if
%>
|
<%set rsy=Server.CreateObject("ADODB.RECORDSET")
rsy.open "select sum(yesterdayprofit) as yessum,count(yesterdayprofit) as cntofb from userbusinesstable where yesterdayprofit > 0 and userpetid="&rs1("userpetid"),conn
if not rsy("yessum")="" then
yesave = cdbl(rsy("yessum")) / cdbl(rsy("cntofb"))
if diff > 1 then
Response.Write(formatNumber(rsy("yessum"),2))
else
Response.Write("0.00")
end if
else
Response.Write("0.00")
end if
%>
|
<%set rsy=Server.CreateObject("ADODB.RECORDSET")
rsy.open "select sum(profit) as yessum from userbusinesstable where userpetid="&rs1("userpetid"),conn
if not rsy.eof then
yesave = cdbl(rsy("yessum")) / countofbusiness
if not diff = 0 then
Response.Write(FormatNumber(yesave,2))
else
Response.Write("0.00")
end if
end if%>
|
<%counter = counter + 1
rs1.movenext
end if
Next
%>