Author |
Topic |
ldiggins
Starting Member
1 Post |
Posted - 2012-02-06 : 19:09:46
|
Hey guys, so ive created a simple timecard form for some staff member to fill out daily. It has a few fields. Jobsite, starttime, endtime, lunchin, lunchout, description, materials used. It repeats for upto 3 jobs (our guys work around alot during the day)When i export into excel its basically one long row all fields. Is there a way to export basically ONE jobsite, and then next jobsite info below the first one? So instead of Looking like this:Employee,date,jobsite,timein,timeout,lunchout,lunchin,description,jobsite2,timein2,lunchin2,lunchout2....ectit would look like thisEmployee,date,jobsite,timein,timeout,lunchin,lunchout,descriptionNEXT ROW DOWNjobsite,timein,timeout...ectAny thoughts? Not thats is a super big issue to cut the row where needed and paste below, just hoping to save a little time. Thanks in advanceLloyd |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-02-06 : 20:26:08
|
i think you need to use ssis and in it apply unpivot transformation to get the details from columns to seperate rows.Another way is to use OPENROWSET and use query likeSELECT Employee,date,jobsite,timein,timeout,lunchout,lunchin,descriptionFROM OPENROWSET(...)UNION ALLSELECT Employee,date,jobsite2,timein2,timeout2,lunchout2,lunchin2,description2FROM OPENROWSET(...).. ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|