I havent had to do a select where dattime =... for a long time now (strange), but it reminded me why I hate doing them (why does the WHERE [Date] has to be different from everything else??)
Anyway, I just want to return a count based on a selected day.
string strCountYesterday = "SELECT COUNT(OID) AS RMA FROM Table WHERE dtStamp =@dtStamp_3";
DateTime dtToday = DateTime.Today;
dtToday = dtToday - new TimeSpan(1, 0, 0, 0);
string strToday = Convert.ToString(dtToday.ToShortDateString());
ci = CultureInfo.CreateSpecificCulture("en-US");
DateTime dtYesterday = DateTime.Parse(strToday,ci);
ci.DateTimeFormat.ShortDatePattern = "MM/dd/YYYY";
CommandCommandText = strCountRMAYesterday;
Command.Connection = Connection;
//dtYesterday format 06/10/2008 00:00:00
but im still not getting any records back, what have i done wrong?