Numbers of Days
Posted: Tue 4 August, 2009 | Author: Lyle | Filed under: Domestic, Geeky, Web Development, Work-related |Leave a comment »A silly reason that I like databases, and SQL…
Herself asked me “How many days between 1st January and August 10th?” – for reasons beyond comprehension.
Normally, something like this would involve figuring out how many weeks, or counting weeks/days in a diary or whatever.
In SQL, it’s a simple “SELECT DATEDIFF(‘2009-01-01′,’2009-08-10’)” and lo, you have the answer. (221 days, if anyone cared)