Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/02/2012, 23:38
sevosalmafuerte
 
Fecha de Ingreso: febrero-2012
Ubicación: Mar del Plata
Mensajes: 2
Antigüedad: 12 años, 2 meses
Puntos: 1
Error con tipo de datos

Hola a todos, soy nuevo en sql y tmb en el foro, espero q me puedan ayudar con este error.

Create table [Viajes]
(
[Fecha] Datetime NOT NULL,
[IdTours] Smallint NOT NULL,
Primary Key ([Fecha],[IdTours])
)
go

Create table [Confirmaciones]
(
[Fecha] Datetime NOT NULL,
[IdTours] Smallint NOT NULL,
[IdCliente] Smallint NOT NULL,
[Seña] Decimal(10,2) NULL,
Primary Key ([Fecha],[IdTours],[IdCliente])
)
go

insert Viajes
select IdTours,DATEADD(YY,1,DATEADD(DD,1,Fecha))
from Confirmaciones
where YEAR(Fecha) = GETDATE() and Seña > 0


Error que me devuelve al ejecutar el codigo en rojo:

Mens. 257, Nivel 16, Estado 3, Línea 1
No se permite la conversión implícita del tipo de datos datetime a smallint. Utilice la función CONVERT para ejecutar esta consulta.