RestonDeveloper
Programmer
Have a table of course/course activity calendar events.
I want to combine records that are the same date, same course into one calander entry.
example
would turn this set
course, date, activity, description, starttime, endtime
science,'11/28/2007', 'lab', 'disect frog', '12:00:00', '14:00:00'
science,'11/28/2007', 'lecture', 'how heart beats', '15:00:00', '17:00:00'
into
course, date, activity, description, starttime, endtime
science,'11/28/2007', 'combined', '<P>lab: disect frog<br>12:00:00-14:00:00</P><P>lecture: how heart beats<br>15:00:00-17:00:00</P>', '12:00:00', '17:00:00'
the way i am going about it now is C# reading in this sql statement: SELECT COUNT(*) AS COUNT, CourseId, [Day], [Month], [Year] FROM tblCalendarFirm_Mediator GROUP BY CourseId, [Day], [Month], [Year] HAVING COUNT(*) > 1
then i loop through data set creating a seperate dataset for having the columns defined above and and making one insert statement, run statement, then delete ids found in record set.
am i making sense? and was this right approach or should this all be contained in a sql procedure, or two.
I want to combine records that are the same date, same course into one calander entry.
example
would turn this set
course, date, activity, description, starttime, endtime
science,'11/28/2007', 'lab', 'disect frog', '12:00:00', '14:00:00'
science,'11/28/2007', 'lecture', 'how heart beats', '15:00:00', '17:00:00'
into
course, date, activity, description, starttime, endtime
science,'11/28/2007', 'combined', '<P>lab: disect frog<br>12:00:00-14:00:00</P><P>lecture: how heart beats<br>15:00:00-17:00:00</P>', '12:00:00', '17:00:00'
the way i am going about it now is C# reading in this sql statement: SELECT COUNT(*) AS COUNT, CourseId, [Day], [Month], [Year] FROM tblCalendarFirm_Mediator GROUP BY CourseId, [Day], [Month], [Year] HAVING COUNT(*) > 1
then i loop through data set creating a seperate dataset for having the columns defined above and and making one insert statement, run statement, then delete ids found in record set.
am i making sense? and was this right approach or should this all be contained in a sql procedure, or two.