We help IT Professionals succeed at work.

Problem selecting between dates

173 Views
Last Modified: 2010-03-19
This statement works correctly:

Select * from QuarterStatus
Where (TimeStart BETWEEN '2007-11-19 00:00:00' and '2008-12-31 23:59:59')

This one returns all records in quarters 4 and 3 reguardless of the date in TimeStart ... I would expect this with the OR clause, but not the AND clause ... what am I doing wrong?

Select * from QuarterStatus
Where (TimeStart BETWEEN '2007-11-19 00:00:00' and '2008-12-31 23:59:59')
and Quarter = 4 Or Quarter = 3
Comment
Watch Question

Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thank you very much, I thought I was loosing my mind.

Mike
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.