title: Fuzzy date storing and searching
body: <p>I'm looking to make a database to hold metadata about a set of pictures and one field I want is date taken.  I'd like to be able to store this with coarse or fine-grained accuracy, e.g. for a digital picture the exact time stamp down to the second will be available, but I'd like to be able to tag a picture as just being taken in a particular year, or even a particular decade (decade being the most coarse I'd go), and also to be able to search in this way, requesting fro example all pictures from the 90s, or all pictures from 1992 or all pictures from a particular day etc.  </p>
  
  <p>I was wondering if there is a built in way way to do this with SQL, or if there is another way that would be better.  I thought about breaking the date up and storing each piece separately, e.g. have a decade field, a year field, a month field etc but this seemed like it might be a slightly clumsy way of doing things.  </p>
  
  <p>I'm not fussed about which SQL technology I use as long as it's free.  I'm looking at H2 at the moment.</p>