Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 14

Discussione: query

  1. #1

    query

    cosa c'è di sbagliato in questa query ?

    Syntax error (missing operator) in query expression '* products where new='1' and tip_UK <> 'RFID' GROUP BY tip_UK ORDER BY DataSF DESC'.

    codice:
    strSQL="SELECT * products where new='1' and tip_UK <> 'RFID' GROUP BY tip_UK ORDER BY DataSF DESC"
    vorrei selezionare tutti i prodotti che hanno il campo new='1' , dove tip_UK è diverso da 'RFID' raggruppandoli per tip_UK e ordinandoli per data

    NOn è possibile ?

  2. #2
    Utente di HTML.it L'avatar di heroes3
    Registrato dal
    Aug 2001
    Messaggi
    2,483
    manca from

    select * from tabella

  3. #3
    no scusa quello è un mio errore di copiatura...

    mi da

    Cannot group on fields selected with '*'

    codice:
    Set objConn = Server.CreateObject("ADODB.Connection") 
    set rs=server.CreateObject("ADODB.recordset")
    
    objConn.Open strCon
    
    strSQL="SELECT * from products where new='1' and tip_UK <> 'RFID' GROUP BY tip_UK ORDER BY DataSF DESC"
    rs.Open strSQL, objConn,3,3
    
    recordsperpage=5
    rs.pagesize=recordsperpage
    Pages=request.querystring("pagina")
    if (len (Pages)>0 and isnumeric(Pages)) then
    Pages=clng(Pages)
    else
    Pages=1
    end if

  4. #4
    Utente di HTML.it L'avatar di heroes3
    Registrato dal
    Aug 2001
    Messaggi
    2,483
    Cannot group on fields selected with '*'

    non puoi raggruppare i campi scelti con '*'

    prova a scegliere tu manualmente i campi che desideri

    tipo

    strSQL="SELECT tip_UK,new,DataSF from products where new='1' and tip_UK <> 'RFID' GROUP BY tip_UK ORDER BY DataSF DESC"



    P.s. cmq l'errore postato prima era riferito proprio al from

  5. #5
    ok grazie

    ma Mod è una funzione di ASP ?

    Syntax error (missing operator) in query expression 'Mod'.

    codice:
    strSQL="SELECT tip_UK,DataSF,Mod,New from products where new='1' and tip_UK<>'RFID' GROUP BY tip_UK ORDER BY DataSF DESC"

  6. #6
    Utente di HTML.it L'avatar di heroes3
    Registrato dal
    Aug 2001
    Messaggi
    2,483
    scusa non capisco
    puoi essere un po + chiaro e magari dirmi tutto insieme piuttosto che un pezzettino per volta???

  7. #7
    scusa...no riesco a far stampare queste informazioni

    mi da questo errore nella riga rs.Open strSQL, objConn,3,3

    You tried to execute a query that does not include the specified expression 'titolo_UK' as part of an aggregate function.

    codice:
    <% 
    Set objConn = Server.CreateObject("ADODB.Connection") 
    set rs=server.CreateObject("ADODB.recordset")
    	
    objConn.Open strCon
    strSQL="SELECT titolo_UK, tip_UK, DataSF, Model, New, code from products where new='1' and tip_UK<>'RFID' GROUP BY tip_UK ORDER BY DataSF DESC" 
    rs.Open strSQL, objConn,3,3
    	
    recordsperpage=5
    rs.pagesize=recordsperpage
    Pages=request.querystring("pagina")
    if (len (Pages)>0 and isnumeric(Pages)) then
    Pages=clng(Pages)
    else
    Pages=1
    end if
    %>

  8. #8
    Utente di HTML.it L'avatar di heroes3
    Registrato dal
    Aug 2001
    Messaggi
    2,483
    in questo nuovo errore semplicemente non esiste un campo che chiami

    titolo_UK


  9. #9
    si che esiste c'è anche applicato un link:

  10. #10
    Utente di HTML.it L'avatar di heroes3
    Registrato dal
    Aug 2001
    Messaggi
    2,483
    che db usi??
    se usi access prova a farla in access
    se usi mysql
    prova a mettere direttamente la query in mysql control center o altri

    e vedere cosa restituisce questa query



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 © 2025 vBulletin Solutions, Inc. All rights reserved.