Is it possible to use GETDATE in SQL Queries with the Dashboard API
Hi,
we need to filter our Query with a DateTime Timestamp from the actual date. We want to get alle Workitems which are last changed in the last 1 day.
Our Code
SELECT DisplayName, LastModified
FROM [CiresonServiceManagement].[dbo].[WorkItem]
where LastModified >= (DATEADD(day, -1, GETDATE())
in Sql we get the right results but in the SQL Dashboard Widget we dont get any result. Dont know why. Can somebody give us a hint on that?
regards,
Jan
Best Answer
-
Peter_Muttenthaler Partner Advanced IT Monkey ✭✭✭
Hi @Jan_Schulz
for me its working but you've forgotten a bracket:
SELECT DisplayName, LastModified
FROM [dbo].[WorkItem]
where LastModified >= (DATEADD(day, -1, GETDATE()))
take care which database you've selected in Cireson ;)
0
Answers
Hi @Jan_Schulz
for me its working but you've forgotten a bracket:
SELECT DisplayName, LastModified
FROM [dbo].[WorkItem]
where LastModified >= (DATEADD(day, -1, GETDATE()))
take care which database you've selected in Cireson ;)
@Peter_Muttenthaler thank you. the small mistakes :-D