EXEMPLO_1212310
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
FN_MESCLADATAHORA
Parameters
Name
Type
Mode
@CAMPODATA
datetime
IN
@CAMPOHORA
varchar
IN
Definition
CREATE FUNCTION FN_MESCLADATAHORA (@CAMPODATA DATETIME, @CAMPOHORA VARCHAR(4)) RETURNS DATETIME BEGIN /*Ex. campoData = '31/12/2000 00:00:00' (DateTime) campoHora = '1230' (varchar(4)) resultado = '31/12/2000 12:30:00' (DateTime) */ DECLARE @DATA AS DATETIME SET @DATA = CONVERT(DATETIME, (CONVERT(VARCHAR(10), @CAMPODATA, 103) + ' ' + SUBSTRING(@CAMPOHORA, 0,3) + ':' + SUBSTRING(@CAMPOHORA, 3,2) + ':00'), 103) RETURN @DATA END