SQL Group by Date Range

I recently solved an interesting problem.  SQL Server datetime column treats a calendar day as being from 12:00 am to 12:00 pm.  Where I work we run production from 03:00 am one day to 03:00 am the next day. We recently needed to add data to our web site that reports daily production totals for the last seven days. After doing some testing I realized that grouping by date was not going to work for two reasons.  Finished products are scanned out anytime during either of our two shifts,  Using a group by date would create individual rows every time…
Read more →

C# params keywork in datalayer

I have been having to access a lot of stored procedures recently and decided it was time to optimize my datalayer class.  I wanted to be able to call just about any stored procedure, that returns a data set, regardless of how many parameters the stored procedure requires. I wrote the following method using the params keyword.  This worked so well that I think I will use this format for update, insert (ExecuteNonQuery methods) and ExecuteScalar methods. public bool GetLookUpData(string storedProc, string spParms, ref SqlDataReader rdr, params string[] strParms) { string[] Parms = spParms.Split(‘,’); StringBuilder sqlErr = new StringBuilder(); try…
Read more →

Current Consulting Project

I am currently consulting for Denso Wireless writing manufacturing traceability systems in C# and ASP.net. Denso Wireless manufactures navigation systems for some of the major automotive manufactures. The manufacturing systems that I develop interface directly to assembly line hardware that in real time collects manufacturing metrics and data and stores this data in a SQL Server database instance. The Traceability system also provides engineering and management real time access to the gathered metrics and data from an internationally accessible web site that is developed in ASP.net.