<%
sql="select MIN(psprice)as askBA from transactions where namecompany='BA'and act='Limit sell order'"
set AskBA=server.createobject("adodb.recordset")
AskBA.open sql,conn,1,3%>
<td height="22" width="41"><div align="center">
<% if not AskBA.eof then
response.write AskBA("askBA")
else
response.write "-"
end if
AskBA.close%>
When there is Data which namecompany=BA and act=Limit sell order in table transactions , it's OK. It shows the minimun price.
But the problem is that when there is no Data which namecompany=BA and act=Limit sell order in table transactions, it should show - But it does not show anything.
I don't know why it does not go to condition Else.The query has returned a row, with NULL for askBA. So EOF is not true, instead you need to test the value of askBA.
No comments:
Post a Comment