Posts

Showing posts from April, 2010

Strange goings on in SQL land

Weird things with dates I have a simple sql script that extracts raw data from a quality centre database and extracts it to an excel spreadsheet, part of this is shown below: SELECT bg_bug_id as DefectID, bg_detection_date as RawDetectionDate, convert(varchar(10), bg_detection_date, 103) as FormatDetDate, bg_closing_date as RawClosingDate, convert(varchar(10), bg_closing_date, 103) as FormatCloseDate FROM BUG The issue I'm having is with the formatted dates. Some come through correctly and are left justified with the correct date, the others come through in US format and are right justified. When looking at the excel cell format, the left justified correct dates are showing as General format, and the incorrect right justified dates are Date format. Yes, I could just do the formatting on the RawDate in Excel which guarantees the correct date, and yes I could do some fancy malarky casting to a string and then back to a date but that...

Logic FAIL: Monty Hall Problem – GAH!

Now those of you who know me well will know that I love maths, I can spend hours and hours playing around with equations and figures and formulae, however a friend (http://rocko.co.nr/) told me at the weekend about the Monty Hall Problem and this one got me right in the logic chip. My first reaction to this was ‘that can’t be right, it doesn’t make mathematical sense’. It is a very counter intuitive problem and one that has caused much debate over the years if my googling on the subject is anything to go by. The problem for those of you who don’t know it: "Suppose you're on a game show and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the other doors, opens another door, say No. 3, which has a goat. He then says to you, 'Do you want to pick door No. 2?' Is it to your advantage to take the switch?” Ref: http://math.ucsd.edu/~crypto/Monty/montybg.htm...

SQL Server 2008 Certifications update

SQL Saturday in Auckland went really well on Saturday. Huge thank you to everyone who attended and especially to Dave Dustin for pulling it all together. On Saturday I re-presented the 15 minute certifications talk. As the last time this was presented was November 2008, there were quite a few changes. The ppt slides have been updated to reflect the changes since Nov 2008 and the latest version has been uploaded. Let me know if you have any questions on any of the presentations or white papers.

Shiny Things

One of the hardest things for me as a geek is forcing myself to walk past shiny new games with large pink SPECIAL OFFER PRICE stickers on them. Please supermarkets, don’t put cut price games on the way to checkouts where you can ensnare sun-starved and fragile geeks. Point in question, yesterday I went into the big red shed to buy a printer for the office and only through sheer willpower managed to come out without Wii Fit Plus, C&C 4 and the new God of War game. I’m getting better at walking past these evil stands of money grabbing games, though yesterday I did pick up C&C 4 and start walking towards the checkout before thinking twice. I stopped myself, turned round taking out some teenagers with my umbrella (quite by accident – it was a comic turn the Marx brothers would have been proud of) and put the game back on the shelf. If I’d bought it there would have been that wonderful rush of instant gratification that comes from buying something new and shiny but I know that...