Hi, I need to fill a new table with data acquired using a SELECT statement
e.g.
MS SQL SERVER
1** I create the table:
--------inicio--------
Create Table TACCESOS2
(
CODIGO INT,
NOMBRE NVARCHAR(20),
FECHA NVARCHAR(20),
HORA NVARCHAR(20),
TERMINAL SMALLINT
);
---------fin----------
2** I want to insert results of this statement in the new table:
SELECT PECODI AS CODIGO, PENOMB AS NOMBRE, SUBSTRING(CAST(FIFECH AS NVARCHAR),1,11) AS FECHA, CAST(FIHORA AS NVARCHAR) AS HORA, FINODO AS TERMINAL
FROM FFICHA,FPERSO
WHERE SUBSTRING(CAST(FFICHA.FICODI AS NVARCHAR),2,11) = FPERSO.PECODI
but I don´t know how to do it
Thanks
e.g.
MS SQL SERVER
1** I create the table:
--------inicio--------
Create Table TACCESOS2
(
CODIGO INT,
NOMBRE NVARCHAR(20),
FECHA NVARCHAR(20),
HORA NVARCHAR(20),
TERMINAL SMALLINT
);
---------fin----------
2** I want to insert results of this statement in the new table:
SELECT PECODI AS CODIGO, PENOMB AS NOMBRE, SUBSTRING(CAST(FIFECH AS NVARCHAR),1,11) AS FECHA, CAST(FIHORA AS NVARCHAR) AS HORA, FINODO AS TERMINAL
FROM FFICHA,FPERSO
WHERE SUBSTRING(CAST(FFICHA.FICODI AS NVARCHAR),2,11) = FPERSO.PECODI
but I don´t know how to do it
Thanks