Yes, in the healthshare environment I am running the following script:
SELECT
id,
substr(TimeCreated, 12, 5) as HORA,
(DATEDIFF(ms, TimeCreated, TimeProcessed)) as TiempoTranscurrido ,
TimeCreated as fecha,
GETDATE() as hora_actual
FROM
ens.messageheader
WHERE
SourceConfigName = 'HL7Filler HCIS'
AND TimeCreated >= '2024-03-19 12:51:11.125'
I would like that in exchange for entering the exact time I could obtain it in the format, I have tried with the following script but it brings me the messages for that exact time and I need to bring all the logs in that time period "2 hours"
SELECT
id,
substr(TimeCreated, 12, 5) as HORA,
(DATEDIFF(ms, TimeCreated, TimeProcessed)) as TiempoTranscurrido ,
TimeCreated as fecha,
GETDATE() as hora_actual
FROM
ens.messageheader
WHERE
SourceConfigName = 'HL7Filler HCIS'
AND TimeCreated >= DATEADD(hour, -2, GETDATE())
Hello, thank you very much for the help, I managed to get what I expected