Siempre Graba 01/01/1900

15/09/2004 - 22:17 por Carmelo Gonzalez | Informe spam
Hola !!!
Disculpen la molestia

ya pude hacer el UPDATE pero ahora falta el Insert

MiComando.CommandText = "INSERT INTO MovimientoCaja (Codigo,
NroMovimiento,Fecha, NroOrigen) Values ('" & cCodCaj & "', '" & sCad & "', "
&
CType(txtFecha.Text, DateTime) & ", '" & txtDocumento.Text & "')"

"INSERT INTO MovimientoCaja (Codigo, NroMovimiento, Fecha, NroOrigen) Values
('0003', '0000000079', 15/09/2004, '222')"

Graba pero la fecha siempre es 01/01/1900, el UPDATE lo solucione asi:
Dim sFecha As String

sFecha = txtFecha.Value.Month & "/" & txtFecha.Value.Day & "/" &
txtFecha.Value.Year
la coloque con formato mm/dd/yyyy

MiComando.CommandText = "UPDATE MovimientoCaja SET NroOrigen = '" &
txtDocumento.Text & "', Origen = '" & txtOrigen.Text & "', Fecha ='" &
sFecha & "' WHERE NroMovimiento = '" & XXX & "'"

Gracias por toda la Ayuda

Preguntas similare

Leer las respuestas

#1 Tinoco
15/09/2004 - 22:31 | Informe spam
Hola.

Te recomiendo dos cosas:
1. coloca las fechas entre comillas simples '2004/01/19'
2. utiliza un formato de año/mes/dia [yyyy/mm/dd].

Hermilson Tinoco

Hola !!!
Disculpen la molestia

ya pude hacer el UPDATE pero ahora falta el Insert

MiComando.CommandText = "INSERT INTO MovimientoCaja


(Codigo,
NroMovimiento,Fecha, NroOrigen) Values ('" & cCodCaj


& "', '" & sCad & "', "
&
CType(txtFecha.Text, DateTime) & ", '" &


txtDocumento.Text & "')"

"INSERT INTO MovimientoCaja (Codigo, NroMovimiento,


Fecha, NroOrigen) Values
('0003', '0000000079', 15/09/2004, '222')"

Graba pero la fecha siempre es 01/01/1900, el UPDATE lo


solucione asi:
Dim sFecha As String

sFecha = txtFecha.Value.Month & "/" & txtFecha.Value.Day


& "/" &
txtFecha.Value.Year
la coloque con formato mm/dd/yyyy

MiComando.CommandText = "UPDATE MovimientoCaja SET


NroOrigen = '" &
txtDocumento.Text & "', Origen = '" & txtOrigen.Text


& "', Fecha ='" &
sFecha & "' WHERE NroMovimiento = '" & XXX & "'"

Gracias por toda la Ayuda
Respuesta Responder a este mensaje
#2 Maxi
15/09/2004 - 22:35 | Informe spam
Hola, leete este articulo:


http://www.microsoft.com/spanish/ms...art157.asp

Salu2
Maxi
Buenos Aires - Argentina
Desarrollador Microsoft 3 Estrellas .NET
Nunca consideres el estudio como una obligación sino como
una oportunidad para penetrar en el bello y maravillosos
mundo del saber.
- Albert Einstein



"Carmelo Gonzalez" escribió en el mensaje
news:%
Hola !!!
Disculpen la molestia

ya pude hacer el UPDATE pero ahora falta el Insert

MiComando.CommandText = "INSERT INTO MovimientoCaja (Codigo,
NroMovimiento,Fecha, NroOrigen) Values ('" & cCodCaj & "', '" & sCad & "',


"
&
CType(txtFecha.Text, DateTime) & ", '" & txtDocumento.Text & "')"

"INSERT INTO MovimientoCaja (Codigo, NroMovimiento, Fecha, NroOrigen)


Values
('0003', '0000000079', 15/09/2004, '222')"

Graba pero la fecha siempre es 01/01/1900, el UPDATE lo solucione asi:
Dim sFecha As String

sFecha = txtFecha.Value.Month & "/" & txtFecha.Value.Day & "/" &
txtFecha.Value.Year
la coloque con formato mm/dd/yyyy

MiComando.CommandText = "UPDATE MovimientoCaja SET NroOrigen = '" &
txtDocumento.Text & "', Origen = '" & txtOrigen.Text & "', Fecha ='" &
sFecha & "' WHERE NroMovimiento = '" & XXX & "'"

Gracias por toda la Ayuda










Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.748 / Virus Database: 500 - Release Date: 01/09/2004
Respuesta Responder a este mensaje
#3 Tinoco
15/09/2004 - 22:36 | Informe spam
Una direccion que te puede servir:

http://www.elguille.info/vb/bases/F...sandoFecha
SQL

Hola !!!
Disculpen la molestia

ya pude hacer el UPDATE pero ahora falta el Insert

MiComando.CommandText = "INSERT INTO MovimientoCaja


(Codigo,
NroMovimiento,Fecha, NroOrigen) Values ('" & cCodCaj


& "', '" & sCad & "', "
&
CType(txtFecha.Text, DateTime) & ", '" &


txtDocumento.Text & "')"

"INSERT INTO MovimientoCaja (Codigo, NroMovimiento,


Fecha, NroOrigen) Values
('0003', '0000000079', 15/09/2004, '222')"

Graba pero la fecha siempre es 01/01/1900, el UPDATE lo


solucione asi:
Dim sFecha As String

sFecha = txtFecha.Value.Month & "/" & txtFecha.Value.Day


& "/" &
txtFecha.Value.Year
la coloque con formato mm/dd/yyyy

MiComando.CommandText = "UPDATE MovimientoCaja SET


NroOrigen = '" &
txtDocumento.Text & "', Origen = '" & txtOrigen.Text


& "', Fecha ='" &
sFecha & "' WHERE NroMovimiento = '" & XXX & "'"

Gracias por toda la Ayuda
Respuesta Responder a este mensaje
#4 Yan Carlos
16/09/2004 - 20:40 | Informe spam
graba asi '20040916' o sea YYYYMMDD
"Carmelo Gonzalez" escribió en el mensaje
news:%
Hola !!!
Disculpen la molestia

ya pude hacer el UPDATE pero ahora falta el Insert

MiComando.CommandText = "INSERT INTO MovimientoCaja (Codigo,
NroMovimiento,Fecha, NroOrigen) Values ('" & cCodCaj & "', '" & sCad & "',
"
&
CType(txtFecha.Text, DateTime) & ", '" & txtDocumento.Text & "')"

"INSERT INTO MovimientoCaja (Codigo, NroMovimiento, Fecha, NroOrigen)
Values
('0003', '0000000079', 15/09/2004, '222')"

Graba pero la fecha siempre es 01/01/1900, el UPDATE lo solucione asi:
Dim sFecha As String

sFecha = txtFecha.Value.Month & "/" & txtFecha.Value.Day & "/" &
txtFecha.Value.Year
la coloque con formato mm/dd/yyyy

MiComando.CommandText = "UPDATE MovimientoCaja SET NroOrigen = '" &
txtDocumento.Text & "', Origen = '" & txtOrigen.Text & "', Fecha ='" &
sFecha & "' WHERE NroMovimiento = '" & XXX & "'"

Gracias por toda la Ayuda





email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida