I have a query that I use to create some reports between different day intervals (usually daily reports). It works great, but now I need the query to figure out by itself the current time and the current time minus 24 hrs. In Oracle I use the function SYSDATE. Is there a similar function on SQL Server?
Here's an example query by the way (the original query is way to long and it might just confuse you)
SELECT (( SUM(AStatistics.PriACD)
+ SUM(AStatistics.PriCTI)
+ SUM(AStatistics.OverACD)
+ SUM(Atatistics.OverCTI)
))
FROM "CCenter1"."dbo"."AgStatistics" "AgStatistics"
INNER JOIN "CCenter1"."dbo"."Ag" "Ag" ON "AgStatistics"."AgID"="Ag"."AgId"
WHERE ("AgStatistics"."ReportDayDate">={ts '2008-09-11 00:00:00'} --I need the current timestamp - 24hrs
AND "AgStatistics"."ReportDayDate"<{ts '2008-09-13 00:00:01'}) --I need the current timestamp
AND "AgMap"."AgFolderIdentity"=9