Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Forum De Bell Tolls > Sql
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
dan
..: Dottore :..

User info:
Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Sql

Come faccio ad inserire una data nulla?

Se faccio:


if(Request("giorno_inizio")="" OR Request("mese_inizio")="" OR Request("anno_inizio")="") then
rs("data_inizio") = ""
else
rs("data_inizio") = Request("giorno_inizio") & "/" & Request("mese_inizio") & "/" & Request("anno_inizio")
end if



Se non inserisco niente come giorno, mese, anno di inizio mi da un errore di tipo!
Come si può fare ad inserire una data nulla?

Grazie, D.

28-10-2003 09:36
Click Here to See the Profile for dan Click here to Send dan a Private Message Visit dan's homepage! Find more posts by dan Add dan to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
loreste
.grande:maestro.

User info:
Registered: Jan 2003
Posts: 730 (0.09 al dì)
Location: Berghem
Corso: Informatica
Anno: -2 alla specialistica
Time Online: 8 Days, 5:47:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Innanzi tutto bisogna vedere la struttura della tabella se hai permesso il valore null nel campo, qualora tu non l'avessi potrebbe essere la causa del tuo problema, in questo caso dovrai modificare tale struttura.

Ciao

__________________
La Fede non retrocede mai!
Döma Atalanta!!!!!!!!

28-10-2003 10:11
Click Here to See the Profile for loreste Click here to Send loreste a Private Message Find more posts by loreste Add loreste to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
dan
..: Dottore :..

User info:
Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Con un campo di tipo data non è possibile consentire il valore nullo.

Ho scritto quanto segue:


if not(Request("giorno_inizio")="" OR Request("mese_inizio")="" OR Request("anno_inizio")="") then
dinizio = Request("giorno_inizio") & "/" & Request("mese_inizio") & "/" & Request("anno_inizio")
end if

if not(Request("giorno_fine")="" OR Request("mese_fine")="" OR Request("anno_fine")="") then
dfine = Request("giorno_fine") & "/" & Request("mese_fine") & "/" & Request("anno_fine")
end if


SQLQuery = "UPDATE eventi_ecm SET cod_azienda = '" & qv1 & "' , titolo = '" & qv2 & "' , luogo = '" & qv3 & "' , location = '" & qv4 & "' , regione = '" & qv5 & "' , citta = '" & qv6 & "' , provincia = '" & qv7 & "' , tel = '" & qv9 & "' , fax = '" & qv10 & "' , data_inizio = '" & dinizio & "' , data_fine = '" & dfine & "' WHERE azienda = '" & Request("azienda") & "' AND titolo = '" & Request("old_titolo") & "' "

Conn.Execute(SQLQuery)



Ma mi dice:


Data type mismatch in criteria expression.
/ecm/modifica.asp, line 125


line 25: linea corrispondente a Conn.Execute

28-10-2003 10:27
Click Here to See the Profile for dan Click here to Send dan a Private Message Visit dan's homepage! Find more posts by dan Add dan to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gusher
Splinter fun club

User info:
Registered: Jan 2003
Posts: 475 (0.06 al dì)
Location: Ovunque
Corso: Informatica
Anno: Done
Time Online: 15 Days, 22:06:15 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

fai un controllo di questo tipo:

strQuery = "UPDATE Table SET Data="

if(strData="") then
strQuery = strQuery & "NULL "
else
strQuery = strQuery & "'strDataCorretta' "
end if

strQuery = strQuery & " WHERE ID=" & ID

28-10-2003 17:48
Click Here to See the Profile for Gusher Click Here to See the Blog of Gusher Click here to Send Gusher a Private Message Find more posts by Gusher Add Gusher to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 03:49.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.443 seconds (41.58% PHP - 58.42% MySQL) con 25 query.