2

how could i get row by filtering in between specific date...

in my table, i have thousand of rows about Ordered Food.

I want to check ordered food between June-01-2011 1:00:00PM to June-05-2011 6:00:00pm. how could i suppose to write t-sql code...

2 Answers 2

2
 select *
 from MyTable
 where MyDate >= `2011-06-01T13:00:00` and  MyDate < '2011-06-05T18:00:00'

if you want to include both datetimes:

 select *
 from MyTable
 where MyDate between `2011-06-01T13:00:00` and  '2011-06-05T18:00:00'
Sign up to request clarification or add additional context in comments.

Comments

1

Making some wild assumption about your table structure basically do this...

Select * from ordered_food 
where ordered_date 
between '2011-06-01 13:00:00' and '2011-06-05 18:00:00'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.