I've got a Microsoft Query set up between a sql database and excel 2010 that I'm trying to filter out some information. Attached is a copy of the report in its current state. You'll see that the attached customer has two jobs in my system, all of which have multiple steps (Work Centers). What I'd like to obtain is limiting the output of this script so that it only shows the first Work Center, which varies depending on the job. Is this possible? Attached is my SQL Code generated by Excel. I tried using LIMIT 1 on the function at the end, but it tells me the code has errors when I apply it. "Job.Job" is the field that contains the job number, which is how I would like to limit it.
Thank You for your help!
SELECT Job.Job, Job.Order_Date, Job.Customer, Job.Customer_PO, Job.Part_Number, Job.Customer_PO_LN, Job.Order_Quantity, Job.Status, Job.Sched_Start, Job.Sched_End, Job_Operation.Work_Center, Job_Operation.Status
FROM PRODUCTION.dbo.Job Job, PRODUCTION.dbo.Job_Operation Job_Operation
WHERE Job.Job = Job_Operation.Job AND ((Job.Status='Active') AND (Job_Operation.Status<>'C'))
ORDER BY Job.Customer