title: Date Time based query in Sql Server 2008
body: <p>I have datetime stored in my table in the fields LeaveFrom and LeaveTo for leaves, something like </p>
  
  <p>LeaveFrom = 05/26/2012 12:00:00 and LeaveTo = 06/30/2012.. and so on</p>
  
  <p>From front end i am passing only Month and Year. So what will be the search condition for the same.</p>
  
  <p>I need criteria for month and year wise searching. How many peoples applied for leave / or were absent  in the particular month.</p>
  
  <p><strong>Thanks to all of you.. almost all were close to expected ...thanks,what i need  was a 'HINT'.. thanks a ton to all of you guys..</strong></p>