Helpful Information
 
 
Category: MS SQL Development
Count of rs results

I have the following Query

SQL = "SELECT tblplayers.PlayerID, p_Fname, p_Sname, Bid_close_date, MAX(tblBid.BiddedPrice) As asMaxbid, MAX(tblBid.DateStamp) As MaxDateStamp FROM tblBid, tblplayers WHERE tblBid.PlayerID = tblplayers.PlayerID and tblplayers.Bid_close_date < # " & NOW & " # GROUP BY p_Fname, p_Sname, Bid_close_date, tblplayers.PlayerID ORDER BY Bid_close_date DESC;"

I have tried to do a count on this but cannot for te life of me get it to work. Has anyone got any ideas?? Is it possible to do a count when the SqL has got a Max() in it?

ANy suggestions would be much appreciated. David

HI
If U want to count records content in recordset U can try this (ASP):
'-------------------
<%
set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = "dsn="&varDBName&";uid="&varDBuser&";pwd="&varpvd
RS.Source = SQL 'Your command string
RS.CursorType = 1
RS.CursorLocation = 2
RS.LockType = 3
RS.Open
RS_numRows = 0
'The answer is
NumberOfRecords=RS.recordCount
%>
'--------------------
this should solve
BYE










privacy (GDPR)