Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 14 su 14

Hybrid View

  1. #1
    la tabella ha un id univoco per record?

  2. #2
    Utente di HTML.it
    Registrato dal
    Jan 2007
    Messaggi
    395
    Si id univoci

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2007
    Messaggi
    395
    Ho fatto così ma non funziona perché scarta il punteggio massimo ovviamente.
    codice:
    if contgare("contacampo") => 2 then
    
    SQL = "SELECT punteggi.codiceGiocatore, Max(punteggi.PuntiCO) AS MaxDiPuntiCO, gare.codicegara, gare.codicecampo "
    SQL = SQL & "FROM punteggi INNER JOIN ["&percorsoserver&"].Gare ON punteggi.CodiceGara = Gare.CodiceGara "
    SQL = SQL & " WHERE punteggi.codicegiocatore = '"&contGare("codicegiocatore") &"' "
    SQL = SQL & "AND gare.codicecampo = "& contGare("codicecampo") &" "
    SQL = SQL & "GROUP BY punteggi.codiceGiocatore, gare.codicegara, gare.codicecampo "
        set rs=FigspConn.execute (Sql) 
    
    MaxDiPuntiCO = rs("MaxDiPuntiCo")
    MaxDiPuntiCO = replace(MaxDiPuntiCO,",",".")
    
    sSQL= "SELECT TOP 1 punteggi.ID, gare.codicegara, gare.codicecampo, punteggi.PuntiCO, punteggi.codicegiocatore "
    sSQL = sSQL & "FROM punteggi INNER JOIN ["&percorsoserver&"].Gare ON punteggi.CodiceGara = Gare.CodiceGara "
    sSQL = sSQL & "WHERE puntiCO = " &MaxDiPuntiCo &" "
    sSQL = sSQL & "AND punteggi.codicegiocatore = '"&rs("codicegiocatore") &"' "
    sSQL = sSQL & "AND gare.codicecampo = "& rs("codicecampo") &" "
    sSQL = sSQL & "ORDER BY punteggi.PuntiCo ASC "
    set rs2=FigspConn.execute (sSql)
    
           sSql = ""
           sSql = sSql & "update Punteggi "
           sSQL = sSQL & "set ScartoPunti = 'S' "
           sSql = sSql & "where ID= " & rs2("ID") & " "
           set rs=FigspConn.execute (sSql) 
     
    end if
    a questo punto dovrei prendere il puntiCO minimo. ho provato ad impostarlo ma il guaio è che per alcuni giocatori il punteggio minimo è paria a 0 (zero) e quindi considera quello. invece voglio che il punteggio 0 venga escluso. Ho inserito nella prima SQL PuntiCO <> 0 ma da errore nella sql. verificando ho capito che l'errore deriva quanto per un determinato giocatore il punteggio 0 è relativo alla seconda codicegara.


    Grazie

  4. #4
    Utente di HTML.it
    Registrato dal
    Jan 2007
    Messaggi
    395
    pensavo funzionasse così:
    codice:
    sSQL= "SELECT TOP 1 punteggi.ID, gare.codicegara, gare.codicecampo, punteggi.PuntiCO, punteggi.codicegiocatore "
    sSQL = sSQL & "FROM punteggi INNER JOIN ["&percorsoserver&"].Gare ON punteggi.CodiceGara = Gare.CodiceGara "
    sSQL = sSQL & "WHERE puntiCO = " &MinDiPuntiCo &" "
    sSQL = sSQL & "AND punteggi.codicegiocatore = '"&rs("codicegiocatore") &"' "
    sSQL = sSQL & "AND punteggi.PuntiCO <> 0 "
    sSQL = sSQL & "AND gare.codicecampo = "& rs("codicecampo") &" "
    sSQL = sSQL & "GROUP BY punteggi.id, gare.CodiceGara, Gare.CodiceCampo, punteggi.codiceGiocatore, punteggi.PuntiCO "
    sSQL = sSQL & "ORDER BY punteggi.PuntiCo ASC "
    set rs2=FigspConn.execute (sSql)
    response.write rs2("codicegiocatore") & " | "
    response.write rs2("codicecampo") & " | "
    response.write rs2("puntiCO") & " <br> "
    response.flush
    ma nell'eseguirla da errore error '80020009'

    la sql si blocca appena trova puntiCO = 0. anche se nell'errore non è specificato

    Grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.