If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Min Function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-06-04, 06:38
gop373 gop373 is offline
Registered User
 
Join Date: Aug 2004
Posts: 77
Min Function

<%
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.
Reply With Quote
  #2 (permalink)  
Old 11-08-04, 12:27
Apel Apel is offline
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 228
that's because the min aggregate returns NULL when there are no rows for it, check for that instead of EOF
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On