Quantcast
Channel: Columna calculada - Stack Overflow en español
Viewing all articles
Browse latest Browse all 3

Columna calculada

$
0
0

Tengo esta tabla con el campo tiempo calculado restando los campos HFin - HInciopero me sale el siguiente Msg

el resultado que debería aparecer en el campo Tiempo es la resta de dos horas es decir si en HInicio esta la hora 10:30 y en Hfin las 11:00 deberia poner en el campo Tiempo 30 Min que es la diferencia entre las dos horas

CREATE TABLE [dbo].[tblactividad](    [CodigoID] [int] IDENTITY(1,1) PRIMARY KEY,    [DocRefe] [varchar](8) NULL,    [NomActivi] [nvarchar](100) NOT NULL,    [CodTarea] [int] NULL,    [CodTipo] [int] NULL,    [CodPrio] [int] NULL,    [CodEstad] [int] NULL,    [CodResp] [int] NULL,    [FCreacion] [datetime] NOT NULL,    [FInicio] [datetime] NOT NULL,    [FFin] [datetime] NOT NULL,    [HInicio] [time](7) NOT NULL,    [HFin] [time](7) NOT NULL,    [Tiempo] AS (HFin-HInicio) PERSISTED,      [CodComplet] [int] NOT NULL,    [Notas] [varchar](1000) NULL,)

MsgMsg 8117, Level 16, State 1, Line 15Operand data type time is invalid for subtract operator.

me pueden ayudar he hecho de todo para hacer esto no me a dado de ninguna forma


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images