#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    7
    Rep Power
    0

    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
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    italy
    Posts
    5
    Rep Power
    0
    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

IMN logo majestic logo threadwatch logo seochat tools logo