get rows that start time and end time between the input time RRS feed

  • Question

  • Hi

    i have 2 columns start time and end time and i want to get all rows that my input time is between the start time and input time column values

    thanks in advance.


    nothing beat the human brain
    Wednesday, May 26, 2010 5:04 AM


  • Something like:

    DateTime inputTime = DateTime.Now;
    var query = 
    	from t in dc.Table
    	where t.StartTime <= inputTime 
    		&& t.EndTime >= inputTime
    	select t;

    I assume that your columns are of DateTime datatype.


    Syed Mehroz Alam
    My Blog | My Articles
    Wednesday, May 26, 2010 5:52 AM