Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    26

    Unanswered: BETWEEN statement

    I was wondering if someone can correct me on this. When I run this query I get no results displayed. By default, I made sure I used all the values from beginning to end to test it.

    USE POS410
    GO
    SELECT SSN#, Hire_date
    FROM Employee
    WHERE Hire_date BETWEEN 1/1/1995 AND 12/31/2005
    GO

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    1/1/1995 is an arithmetic expression meaning "1 divided by 1 divided by 1995"

    this will round off to zero

    you will probably get some results if you write this --

    WHERE Hire_date BETWEEN '1995-01-01' AND '2005-12-31'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2005
    Posts
    26
    that did the trick! thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •