query to count records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fary4u
    Contributor
    • Jul 2007
    • 273

    query to count records

    code works fine it's counts the records but not bring updated record?

    is there any other way to count records ?
    Code:
    Set rs = Server.CreateObject("ADODB.Recordset")      
    strSQL = "SELECT sum(qanty) as Count from itemsOrd WHERE orderID = " & OrderID
    	rs.Open strSQL, conn, _
    	adOpenStatic, adLockOptimistic
    	numitems = rs("Count")
    	response.write numitems
    result showing
    if i add 10 it's showing 1?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I don't know what you're trying to say. You say you're trying to use a count, but then you use a sum instead of a count. You mention updating some record but you don't say what you're updating or how/when/why you're updating and the effects that's supposed to have. You mention adding 10 something but you don't say how/when/why/what you're adding.

    Comment

    Working...