Tao Te KaChing
Workin' the cash register of the Great Tao

C#, T-SQL, and Me

This entry is really just a rant.

During these last few weeks, I have been kicking bugs' and errors' asses. Anything from downright dumb keystroke errors to more obscure "this data ain't quite right, but I'm not sure exactly what it's supposed to look like" stored procs and embedded queries, to a fierce battle with FTP and configuration files. But the last two days have made me want to drown myself in a bucket of mud and fecal matter.

I have been struggling with a stupid, simple, retarded date-time filter control for our C# admin app. There was a particular record for June 6th at 3:57pm which, whenever I adjusted the time to 3:07pm for that day, it would be filtered out. I have been ripping my farging hair out trying to fix this, to no avail.

Then, while working on some C# code, I was string formatting a datetime object. yyyyMMddHHmm...wait a minute...Went into SQL Books Online and lo and behold, DATEPART uses 'mi' for minutes filtering. I'd been so used to C# formatting, I just didn't think to...DOH!

Now, that was dumb.

What really chaps my hide is why C# datetime formatting can't use 'mi', knowing that 99.8256% of the C# developers out there will be mixing it up with some SQL, too. Little things like that might save the planet billions of hours of debugging time.