I wondered if anyone can help. I need to get the date and time an sql query was run. I would like the output to be in the following format; YYYY-MM-DDThh:mm:ss Does anyone know what sql to write get this information please?
Thanks
Advertisement
Answer
You can select the current timestamp in the query. The standard SQL for that is:
select . . ., current_timestamp from . . .
Most databases support this. However, there are also bespoke methods such as getdate()
, now()
and sysdate
.