Answers
May 17, 2011 - 09:16 PM
System.DateTime endDate = System.DateTime.Now;
System.DateTime startDate = endDate.AddDays(-7);
then search between start and end date
read this for more info
http://msdn.microsoft.com/en-us/libra...
May 20, 2011 - 12:41 AM
for 7 days- select * from emp where dtime between "+System.datetime.now.addDays(-7).tosortdatetime()+" and "+System.datetime.now.tosortdatetime()+"
for 15 days- select * from emp where dtime between "+System.datetime.now.addDays(-15).tosortdatetime()+" and "+System.datetime.now.tosortdatetime()+"
for 7 days- select * from emp where dtime between "+System.datetime.now.addDays(-30).tosortdatetime()+" and "+System.datetime.now.tosortdatetime()+"
May 20, 2011 - 10:14 PM
Add New Comment