I posted earlier and didn't get any response about trying to get a report built around a few date differences. Basically, this is what I have:<BR><BR>START CODE<BR>Sub CreateCalcTable(sender as Object, e as EventArgs)<BR> dim atsConn as New OleDbConnection<BR> dim cmdGetRecords as New OleDbCommand<BR> dim cmdGet1d as New OleDbCommand<BR> dim cmdGet2d as New OleDbCommand<BR> dim cmdGet3d as New OleDbCommand<BR> dim cmdGet4d as New OleDbCommand<BR> dim cmdGet5d as New OleDbCommand<BR> dim cmdGetOpen as New OleDbCommand<BR> dim cmdGetClosed as New OleDbCommand<BR> <BR> dim cmdRepCount as New OleDbCommand<BR> dim cmdReps as New OleDbCommand<BR> dim cmdOpenRecords as New OleDbCommand<BR> <BR> dim daGetRecords as OleDbDataAdapter<BR> dim daGet1d as OleDbDataAdapter<BR> dim daGet2d as OleDbDataAdapter<BR> dim daGet3d as OleDbDataAdapter<BR> dim daGet4d as OleDbDataAdapter<BR> dim daGet5d as OleDbDataAdapter<BR> dim daGetOpen as OleDbDataAdapter<BR> dim daGetClosed as OleDbDataAdapter<BR> <BR> Dim daRepsCount as OleDbDataAdapter<BR> dim daReps as OleDbDataAdapter<BR> <BR> dim dsGetRecords as New DataSet()<BR> dim dsRepsCount as New DataSet()<BR> dim dsReps as New DataSet()<BR> <BR> dim dsGet1d as New DataSet()<BR> dim dsGet2d as New DataSet()<BR> dim dsGet3d as New DataSet()<BR> dim dsGet4d as New DataSet()<BR> dim dsGet5d as New DataSet()<BR> dim dsGetOpen as New DataSet()<BR> dim dsGetClosed as New DataSet()<BR> <BR> <BR> dim drReps as OleDbDataReader<BR> <BR> dim strStartDate as DateTime = txtStartDate.Text<BR> dim strEndDate as DateTime = txtEndDate.Text<BR> dim Value() as Integer<BR> <BR> dim dtScorecard as New DataTable<BR> <BR> 'Create Columns<BR> dim dcOneDay as New DataColumn("1d", GetType(Integer))<BR> dim dcTwoDay as New DataColumn("2d", GetType(Integer))<BR> dim dcThreeDay as New DataColumn("3d", GetType(Integer))<BR> dim dcFourDay as New DataColumn("4d", GetType(Integer))<BR> dim dcFiveDay as New DataColumn("5d", GetType(Integer))<BR> dim dcSixDay as New DataColumn("6d+", GetType(Integer))<BR> dim dcRepName as New DataColumn("Rep", GetType(String))<BR> dim dcTotalOpen as New DataColumn("Total Open", GetType(Integer))<BR> dim dcTotalClosed as New DataColumn("Total Closed", GetType(Integer))<BR> <BR> dtScorecard.Columns.Add(dcRepName)<BR> dtScorecard.Columns.Add(dcTotalOpen)<BR> dtScorecard.Columns.Add(dcTotalClosed)<BR> dtScorecard.Columns.Add(dcOneDay)<BR> dtScorecard.Columns.Add(dcTwoDay)<BR> dtScorecard.Columns.Add(dcThreeDay)<BR> dtScorecard.Columns.Add(dcFourDay)<BR> dtScorecard.Columns.Add(dcFiveDay)<BR> dtScorecard.Columns.Add(dcSixDay)<BR> <BR> Dim d1 as Integer<BR> Dim d2 as Integer<BR> Dim d3 as Integer<BR> Dim d4 as Integer<BR> Dim d5 as Integer<BR> Dim d6 as Integer<BR> <BR> Dim rClosed as Integer<BR> Dim rOpen as Integer<BR> <BR> dim dr as DataRow<BR> <BR> atsConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/data/ats_database.mdb"))<BR> atsConn.Open()<BR> <BR> cmdRepCount = new OleDbCommand("Select Count(RepName) as RepCount from RepIDs Where RepTitle ='ATS - Engineer' OR RepTitle='ATS - Phone'",atsConn)<BR> cmdReps = new OleDbCommand("Select RepName from RepIDs Where RepTitle ='ATS - Engineer' OR RepTitle='ATS - Phone'",atsConn)<BR> <BR> daRepsCount = New OleDbDataAdapter(cmdRepCount)<BR> daRepsCount.Fill(dsRepsCount, "NumReps")<BR> daReps = New OleDbDataAdapter(cmdReps)<BR> daReps.Fill(dsReps, "Reps")<BR> <BR> dim i as integer = 0<BR> dim MaxReps as Integer = (dsRepsCount.Tables("NumReps").Rows(0).Item("RepCo unt"))-1<BR> dim Rep as String<BR> <BR> <BR> for i=0 to MaxReps<BR> <BR> Rep = dsReps.Tables("Reps").Rows(i).Item("RepName")<BR> <BR> cmdGetRecords = new OleDbCommand("Select Count(DateClosed) as cDate from events_main where DateAssigned BETWEEN #" _<BR> & strStartDate & "# AND #" & strEndDate & "# And ClosedEvent=True" & " AND DateClosed-DateAssigned > 5" _<BR> & " AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> cmdGet1d = new OleDbCommand("Select Count(DateClosed) as oneDate from events_main where DateAssigned BETWEEN #" _<BR> & strStartDate & "# AND #" & strEndDate & "# And ClosedEvent=True" & " AND DateClosed-DateAssigned <= 1" _<BR> & " AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> cmdGet2d = new OleDbCommand("Select Count(DateClosed) as twoDate from events_main where DateAssigned BETWEEN #" _<BR> & strStartDate & "# AND #" & strEndDate & "# And ClosedEvent=True" & " AND DateClosed-DateAssigned = 2" _<BR> & " AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> cmdGet3d = new OleDbCommand("Select Count(DateClosed) as threeDate from events_main where DateAssigned BETWEEN #" _<BR> & strStartDate & "# AND #" & strEndDate & "# And ClosedEvent=True" & " AND DateClosed-DateAssigned = 3" _<BR> & " AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> cmdGet4d = new OleDbCommand("Select Count(DateClosed) as fourDate from events_main where DateAssigned BETWEEN #" _<BR> & strStartDate & "# AND #" & strEndDate & "# And ClosedEvent=True" & " AND DateClosed-DateAssigned = 4" _<BR> & " AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> cmdGet5d = new OleDbCommand("Select Count(DateClosed) as fiveDate from events_main where DateAssigned BETWEEN #" _<BR> & strStartDate & "# AND #" & strEndDate & "# And ClosedEvent=True" & " AND DateClosed-DateAssigned = 5" _<BR> & " AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> cmdGetOpen = new OleDbCommand("Select Count(DateAssigned) as NumOpen from events_main where ClosedEvent=False " _<BR> & "AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> cmdGetClosed = new OleDbCommand("Select Count(DateClosed) as NumClosed from events_main where DateAssigned BETWEEN #" _<BR> & strStartDate & "# AND #" & strEndDate & "# And ClosedEvent=True AND TechAssigned='" & Rep & "'", atsConn)<BR> <BR> daGet1d = new OleDbDataAdapter(cmdGet1d)<BR> daGet1d.Fill(dsGet1d, "Day1")<BR> daGet2d = new OleDbDataAdapter(cmdGet2d)<BR> daGet2d.Fill(dsGet2d, "Day2")<BR> daGet3d = new OleDbDataAdapter(cmdGet3d)<BR> daGet3d.Fill(dsGet3d, "Day3")<BR> daGet4d = new OleDbDataAdapter(cmdGet4d)<BR> daGet4d.Fill(dsGet4d, "Day4")<BR> daGet5d = new OleDbDataAdapter(cmdGet5d)<BR> daGet5d.Fill(dsGet5d, "Day5")<BR> daGetRecords = new OleDbDataAdapter(cmdGetRecords)<BR> daGetRecords.Fill(dsGetRecords, "Day6")<BR><BR> daGetOpen = new OleDbDataAdapter(cmdGetOpen)<BR> daGetOpen.Fill(dsGetOpen, "rOpen")<BR> daGetClosed = new OleDbDataAdapter(cmdGetClosed)<BR> daGetClosed.Fill(dsGetClosed, "rClosed")<BR> <BR> d1 = dsGet1d.Tables("Day1").Rows(i).Item("oneDate")<BR> d2 = dsGet2d.Tables("Day2").Rows(i).Item("twoDate")<BR> d3 = dsGet3d.Tables("Day3").Rows(i).Item("threeDate")<B R> d4 = dsGet4d.Tables("Day4").Rows(i).Item("fourDate")<BR > d5 = dsGet5d.Tables("Day5").Rows(i).Item("fiveDate")<BR > d6 = dsGetRecords.Tables("Day6").Rows(i).Item("cDate")< BR> <BR> rOpen = dsGetOpen.Tables("rOpen").Rows(i).Item("NumOpen")< BR> rClosed = dsGetClosed.Tables("rClosed").Rows(i).Item("NumClo sed")<BR> <BR> dr = dtScorecard.NewRow()<BR> dr("Rep") = Rep<BR> dr("1d") = d1<BR> dr("2d") = d2<BR> dr("3d") = d3<BR> dr("4d") = d4<BR> dr("5d") = d5<BR> dr("6d+") = d6<BR> dr("Total Open") = rOpen<BR> dr("Total Closed") = rClosed<BR> dtScorecard.Rows.Add(dr)<BR> Next<BR> <BR> dgScorecard.DataSource = dtScorecard<BR> dgScorecard.DataBind()<BR> atsConn.Close()<BR> End Sub<BR>END CODE<BR><BR>The DataGrid it's binding too is simple and relys on auto-generated values. <BR><BR>I get a Grid and output, and the values that aren't coming out as I like. Things for Opened/Closed are of course correct, and anything that ends up being >5 seems to show up as well. However, the rest of the dates either end up as 0 or as the total number closed, and I can't seem to figure out why. Is there a better way to impliment what I'm trying to do here? I've been searching all day and coming up empty.