I have this SQL Statement:
select distinct r.route as [Name],j.route as Route,j.run as Run,'NULL' AS Parent,(cast(j.route as varchar(64)) + cast(j.run as varchar(64))) as [UID],'Routes' as [Type]
from jobs as j,[route] as r
where j.date = '12/08/2008' and j.van = 1 and r.id = j.route
Essentially what I am trying to do is extract the Distinct Route, but present the data in the form:
Name, Route, Run, Parent, UID, Type
But somewhere along the line my SQL has gotten a bit mistaken and I've been staring at my statements too long to even spot a solution.