2
I have a table in sqlserver that will be logged error logs in which it contains the following fields:
sequence date message
I would like to know how to get the results of the last 30 minutes according to the current date that runs the example job:
date: 08/10/2014 10:00
10:08/2014 09:30
Assuming that the job will run at 10:30 it should bring only the error occurred at 10:00
How can I mount a query to get this result.
Note: I’ve already been able to mount the code that will put this record in a table I really only need to extract the records from the last 30 minutes each time it runs.
use functions such as DATEADD E GETDATE http://technet.microsoft.com/en-us/library/aa258863%28v=sql.80%29.aspx
– Motta
Thank you Motta, perfect your explanation and solution.
– Jean Braz
No, the Omni who gave the solution I just pointed to the source.
– Motta
@Motta we put at the same time. I will edit the answer and put your link to anyone who wants to deepen the knowledge about these functions.
– Omni