Allora sto cercando di fare una sorta di scontrino per ekommerce..
praticamente:
ho due query la prima mi serve per tirare su il campo data (contiene l'ultima data di acquisto via ekommerce del cliente)
esempio compro ora un prodotto, nel campo apparira "12/01/05 16.58.30"
la seconda query mi tira su i prodotti che ho comperato in quella data (naturalmente la where è composta dal campo utente e dal suddetto campo data)
ebbene, l'ultima query mi appare sempre come se fosse vuota...
vi posto il codice:
codice:<% ' Get the shopping cart sqlString = "SELECT (max([order_entrydate])) AS Data FROM orders WHERE orders.order_userID = " & pippo & " " 'response.write sqlString:response.end SET RSdata = Conn.Execute( sqlString ) vardata = "#" & rsdata("data") & "#" slqorder = "SELECT orders.order_id, orders.order_productID, orders.order_quantity, orders.order_userID, orders.order_entrydate, orders.order_shipdate, orders.order_status, orders.order_price, Products.Product_Name FROM orders INNER JOIN Products ON orders.order_productID = Products.Product_ID where (orders.order_userID = " & username & ") and (orders.order_entrydate = " & vardata & ") " 'response.write slqorder:response.end SET RS = Conn.Execute(slqorder) IF RS.EOF and pippo = "" THEN %> <p align="center">Non ci sono prodotti nel tuo carrello della spesa </p> <% ELSE orderTotal = 0 %> <%=vardata%> <div align="center"> <table width="449" cellspacing="0" cellpadding="0"> <tr> <td width="55%" align="left" bgcolor="#336699"> <font color="#FFFFFF" size="1">Prodotto</font></td> <td width="32%" bgcolor="#336699"><font color="#FFFFFF" size="1">Prezzo</font></td> <td width="16%" bgcolor="#336699"><font color="#FFFFFF" size="1">Quantità</font></td> </tr> <% WHILE not RS.EOF orderTotal = orderTotal + ( RS( "order_price" ) * RS( "order_quantity" ) ) %> <tr> <td width="55%" align="left"><font size="1"><%=RS( "product_name" )%></font></td> <td width="32%"><font size="1">€ <%=( RS( "order_price" ) )%></font></td> <td width="16%"><font size="1"><%=RS( "order_quantity" )%></font></td> </tr> <tr> <td></td> <td><center> <font size="1"> [img]Images/tab_c_sfnd_b1.jpg[/img] [img]Images/tab_c_sfnd_b1.jpg[/img] [img]Images/tab_c_sfnd_b1.jpg[/img] [img]Images/tab_c_sfnd_b1.jpg[/img] [img]Images/tab_c_sfnd_b1.jpg[/img] [img]Images/tab_c_sfnd_b1.jpg[/img] </font> </center></td> <td></td> </tr> <% RS.MoveNext WEND %> <tr> <td><font size="1">Totale</font></td> <td><font size="1"> € <%=( orderTotal )%></font> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> <script language= "Javascript1.2"> var message = "Stampa Ordine"; function printpage() { window.print(); } document.write("<input type=Button " +"value=\""+message+"\" onClick=\"printpage()\">"); </script> </td> <td valign="top"> </td> </tr> </table> </div> <% END IF %>
ora vi aggiungo la stampa della query su video:
avete qualche suggerimento???codice:SELECT orders.order_id, orders.order_productID, orders.order_quantity, orders.order_userID, orders.order_entrydate, orders.order_shipdate, orders.order_status, orders.order_price, Products.Product_Name FROM orders INNER JOIN Products ON orders.order_productID = Products.Product_ID where (orders.order_userID = 500041) and (orders.order_entrydate = #12/01/2005 16.02.26#)
non trovo l'errore, eppure se la eseguo in access funziona...
![]()
![]()
![]()


Rispondi quotando