Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    77

    Unanswered: Min Function Problem

    <%
    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.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    The query has returned a row, with NULL for askBA. So EOF is not true, instead you need to test the value of askBA.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •