c# String Query to find top 10 Repeated records in database by Date Range

  • Thread starter Thread starter Booney440
  • Start date Start date
B

Booney440

Guest
I would like to thanks everyone on this site for the help I have received.

An earlier post I was seeking a way to find the Top 10 repeated records

which was resolved, I want to take it a step further and find the Top 10

records by a Date range. The code below is still repeating Top 10 in Data Base

Not by Date Range. dt10 and dt11 are the Date Time Picker.



string queryString = "SELECT * FROM HotSheetID WHERE ILC.Today BETWEEN '{0}' AND '{1}' , dt10.Text, dt11.Text";
// string.Format("WHERE ILC.Today BETWEEN '{0}' AND '{1}' ", dt10.Text, dt11.Text);
queryString = "SELECT TOP 10 " +
"Part,(Part) As PartNumber" +
"Part,COUNT(Part) As PartCount " +
"FROM ILC " +
"GROUP BY Part " +
"Order by COUNT(Part) DESC";

loadDataGrid(queryString);


1323525.jpg


Booney440

Continue reading...
 
Back
Top