Re: How to deal with SQL Query when there are no results
Hi,
It is a simple SELECT query - I would rather not share the exact contents, for obvious reasons, but here is something similar;
SELECT
dbo.Incidents.IncidentID,
dbo.Incidents.Reference,
dbo.Funds.RequestID,
dbo.Funds.RequestAmount,
FORMAT(dbo.Funds.RequestDate, 'dd/MM/yyyy', 'en-us') as FundsReqDate
FROM
dbo.Incidents INNER JOIN dbo.Funds ON dbo.Incidents.IncidentID=dbo.Funds.IncidentNumber INNER JOIN dbo.Timelapse ON dbo.Funds.RequestDate>dbo.Timelapse.Weekago
Timelapse is a 'View' on SQL server and calculates the date of -7 days - It's something we use for a lot of queries.
So when no new records are found for the last 7 days, it returns 'Null' to Flow, which breaks the condition statement.