// Get Record sales of year public DataTable GetWeekDayRecord(string connectionString, string weekDay, DateTime selectDate) { StoreRemoteDataBaseUitility remoteDataBase = new StoreRemoteDataBaseUitility(connectionString); string query = "select top 1 BusinessDate, datename(dw,BusinessDate) as WeekOfDay, (ClosingGrandTotal - OpeningGrandTotal) as PerDaySale " + " from dbo.OpeningInformation where datename(dw,BusinessDate) = " + SQLUtility.getString(weekDay) + " " + " and BusinessDate > DateADD(YEAR, -1, '" + selectDate.ToString("yyyy/MM/dd") + "') and BusinessDate <= '" + selectDate.ToString("yyyy/MM/dd") + "' order by (ClosingGrandTotal - OpeningGrandTotal) desc"; DataTable dt = remoteDataBase.FetchDataWithException(query); return dt; }