Need some ideas on implementing GANTT chart

I have a data set, it is created from a query that populates a table, I wish to take this dataset and use it to populate a GANTT chart. However the data in the dataset is not correctly laid out for use in the GANTT chart. Attached is a file of the dataset. What I would like to do with the GANTT chart is Display the jobtask, which in this dataset is a bigint, then use the first start, the one with the employee name beside it as the start and then the start without the employee name as the end. Is it possible or should I just redo the query or what would be the best approach here. Any help or guidlines very much welcomed and thanked. Have a great day.


Try using the following query against your database table:

select RTRIM(CAST(a.jobtask as char(20))) as taskname, a.start as startdate, b.start as enddate, percentagedonecolumn as percentagedone from tablename a inner join tablename b on a.jobtask = b.jobtask and a.mech1 <> '' and b.mech1 = '' where machine = 49 and shift = 1
You’ll need to change the column and the table names to match yours. You might want to set up an appropriate index to speed up the queries.

If the “empty” cells of your mech1 column are NULLs instead of empty strings, use the following:

select RTRIM(CAST(a.jobtask as char(20))) as taskname, a.start as startdate, b.start as enddate, percentagedonecolumn as percentagedone from tablename a inner join tablename b on a.jobtask = b.jobtask and a.mech1 is not NULL and b.mech1 is NULL where machine = 49 and shift = 1