Hello friends, before saying anything I want you to know that my access and SQl knowledge is very poor..
I have an access query with following sql code..
SELECT ([PCs].[Title]) AS PC, IIf(Left([Technologies.Title],4)="comp","compounding","Fill/Pack") AS Tech, [Departments.Title] AS Department, [Lines.Title] AS [Line_Comp_Fill-Pack], Lines.Supplier, Lines.[Maximum line speed (pcs/min)], Lines.[Size (liter)], Lines.[Product containment], Lines.[Formats in place], Machines.Title AS Machines, Machines.[Speed (pcs/min)], Machines.Supplier, Machines.[Machine model], Machines.[Serial number], Machines.[Year of construction], Machines.[Power supply (V), (Hz)]
FROM (((PCs INNER JOIN Technologies ON PCs.ID = Technologies.PC) INNER JOIN Departments ON Technologies.ID = Departments.Technology) INNER JOIN Lines ON Departments.ID = Lines.parentDepartment) INNER JOIN Machines ON Lines.ID = Machines.Line
WHERE (((([PCs].[Title])) Not Like "zz*" And (([PCs].[Title])) Not Like "*Example*" And (([PCs].[Title])) Is Not Null) AND (([Departments.Title])<>"xxxx_Old"))
ORDER BY ([PCs].[Title]), IIf(Left([Technologies.Title],4)="comp","compounding","Fill/Pack"), [Departments.Title], [Lines.Title];
Now, i want to add a new column(Line) to this query with following MYSQL code...
SELECT t1.*, case when t1. Line_Comp_Fill-Pack = t2. Line_Comp_Fill-Pack then 'M' else 'L' END as Line
FROM (select rank = row_number() over (order by field asc), * from access-table) as t1,
(select rank = row_number() over (order by field asc), * from access-table) as t2
WHERE( t1.rank+1 = t2.rank )
But i couldn't figure ou..how to bind both these codes..Please help me out!
Thanks in advance...