Hi
I am looking to return a value in a column of my query if the query returns no results, figuring this will need to be done with a stored procedure...
does anyone know how to perform this the query i have is shown below that works fine if a job exists, all i wish to do is if no results are found return string 'No Jobs' in the equipment field of my query, ..
any pointers . will be gladly appreciated... last task finally!!!
I am looking to return a value in a column of my query if the query returns no results, figuring this will need to be done with a stored procedure...
does anyone know how to perform this the query i have is shown below that works fine if a job exists, all i wish to do is if no results are found return string 'No Jobs' in the equipment field of my query, ..
any pointers . will be gladly appreciated... last task finally!!!
Code:
SELECT dbo.Calendar.[Job Date], dbo.Calendar.NextBusinessDay, dbo.JobSpec.Branch, dbo.JobSpec.[Deliver Time], dbo.JobSpec.[Job Type],
dbo.JobSpec.[Company Name], dbo.JobSpec.[Site Location], dbo.JobSpec.Equipment, dbo.JobSpec.[Purchase Goods], dbo.JobSpec.Driver,
dbo.Calendar.ID
FROM dbo.Calendar INNER JOIN
dbo.JobSpec ON dbo.Calendar.ID = dbo.JobSpec.ID
WHERE (dbo.Calendar.[Job Date] = [dbo].fn_AddBizDays(1)) AND (dbo.JobSpec.Branch = 'Salisbury')