Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Iran
    Posts
    5

    Unanswered: Problem with date in select statement

    I use this statement to request a query from DB :

    SELECT *
    FROM Recipts
    WHERE (StockCode = 1000100001 ) and (ReciptDate > 2002-1-1 )and (ReciptDate < 2003-1-1 )

    I have a row in DB with these fields

    (StockCode = 1000100001)
    and
    (ReciptDate = 2002-12-08 00:00:00.000)

    but my query return no rows

    why this happened !

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    use single quotes around your date strings

    where ... ReciptDate > '2002-01-01'
    and ReciptDate < '2003-01-01'

    rudy

Posting Permissions

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