Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General » SQL Server »

conversion failed when converting datetime from character string

Estas en el tema de conversion failed when converting datetime from character string en el foro de SQL Server en Foros del Web. Buenas a todos. Tengo un problema para insertar datos en sql me aparece el sig. error: Msg 241, Level 16, State 1, Line 2 Conversion ...
  #1 (permalink)  
Antiguo 13/10/2014, 11:34
 
Fecha de Ingreso: agosto-2014
Mensajes: 3
Antigüedad: 9 años, 7 meses
Puntos: 0
Mensaje conversion failed when converting datetime from character string

Buenas a todos.

Tengo un problema para insertar datos en sql me aparece el sig. error:

Msg 241, Level 16, State 1, Line 2
Conversion failed when converting date and/or time from character string.


Este es mi Query:

Código SQL:
Ver original
  1. INSERT INTO [dbo].[FACTF01]
  2.            (TIP_DOC,CVE_DOC,CVE_CLPV,STATUS,DAT_MOSTR,CVE_VEND,CVE_PEDI,FECHA_DOC,FECHA_ENT,FECHA_VEN,FECHA_CANCELA,CAN_TOT,IMP_TOT1,IMP_TOT2,IMP_TOT3,IMP_TOT4,DES_TOT,DES_FIN,COM_TOT,CONDICION,CVE_OBS,NUM_ALMA,ACT_CXC,ACT_COI,ENLAZADO,TIP_DOC_E,NUM_MONED,TIPCAMB,NUM_PAGOS,FECHAELAB,PRIMERPAGO,RFC,CTLPOL,ESCFD,AUTORIZA,SERIE,FOLIO,AUTOANIO,DAT_ENVIO,CONTADO,CVE_BITA,BLOQ,FORMAENVIO,DES_FIN_PORC,DES_TOT_PORC,IMPORTE,COM_TOT_PORC,METODODEPAGO,NUMCTAPAGO,TIP_DOC_ANT,DOC_ANT,TIP_DOC_SIG,DOC_SIG)
  3.      VALUES
  4.            ('F', 'B4080', '90529', 'E', '17100', '4', '', (CONVERT (VARCHAR (29),'20140822000000000', 113)), (CONVERT (VARCHAR (29), '20140822000000000', 113)), (CONVERT (VARCHAR, '20141006000000000', 113)), 'NULL', '445.12', '235.91', '0', '0', '108.97', '0', '0', '13.35', 'NULL', '0', '1', 'S', 'N', 'O', 'O', '1', '1', '1', (CONVERT (VARCHAR, '20140822095743', 113)), '0', 'GSC101206PE6', '0', 'T', '0', 'B', '4080', '', '0', 'N', '222658', 'N', 'A', '0', '0', '790', '3', 'TRANSF.BBV BANCOMER', '1503', '', '', 'NULL', 'NULL')
  5. GO

GRACIAS

Última edición por gnzsoloyo; 13/10/2014 a las 14:09
  #2 (permalink)  
Antiguo 13/10/2014, 11:42
Avatar de iislas
Colaborador
 
Fecha de Ingreso: julio-2007
Ubicación: Mexico, D.F.
Mensajes: 6.482
Antigüedad: 16 años, 9 meses
Puntos: 180
Respuesta: conversion failed when converting datetime from character string

Creo que el error es muy descriptivo, estas teniendo problemas para colocar en un campo de tipo DATE, algo que no es fecha, necesariamente
__________________
MCTS Isaias Islas
  #3 (permalink)  
Antiguo 13/10/2014, 11:48
 
Fecha de Ingreso: agosto-2014
Mensajes: 3
Antigüedad: 9 años, 7 meses
Puntos: 0
Respuesta: conversion failed when converting datetime from character string

Gracias iislas por contestar pues fijate que en los campos de fechas he puesto varios formatos de fecha y aun así me marca el mismo error, estos son algunos que he puesto

20140822

2014-08-22

2014/08/22

E incluso lo he dejado en blanco
  #4 (permalink)  
Antiguo 13/10/2014, 13:10
Avatar de Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: conversion failed when converting datetime from character string

select getdate() y veras el formato de fecha que tiene tu servidor :)

Y aunque has usado un formato de fecha diferente sigues usando yyyy mm dd
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me

Etiquetas: conversion, datetime, failed, query, sql, string
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:01.