I have datetime stored in my table in the fields LeaveFrom and LeaveTo for leaves, something like
LeaveFrom = 05/26/2012 12:00:00 and LeaveTo = 06/30/2012.. and so on
From front end i am passing only Month and Year. So what will be the search condition for the same.
I need criteria for month and year wise searching. How many peoples applied for leave / or were absent in the particular month.
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..
As far as I can tell, you want all rows that has overlap between LeaveFrom and LeaveTo with the chosen month. I provided some sample dates as documentation.
EDIT: another possible way with same result:
Result: