SQL Query return value in field if no results..

dodyryda

Registered User.
Local time
Today, 01:29
Joined
Apr 6, 2009
Messages
61
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!!!

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')
 
Thanks Gizmo..

But I cannot do in 2 processes as this query is called from outside access i need to perform the action in one procedure..
 

Users who are viewing this thread

Back
Top Bottom