Results 1 to 3 of 3

Thread: Simple Select with date clause [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Simple Select with date clause [Resolved]

    I am running MSSQL 2K SP3 and using a very simple select statement to grab some files from a table:

    Code:
    SELECT * FROM [Hours] WHERE InputDate = '11/16/2004' AND CType = 1 AND ReadNum = 2 ORDER BY CellID
    The datatype for the field is smalldatetime and I've tried several combinations of dates and times, and even used the LIKE operator. The only way I can get it to work is to use the BETWEEN operator and check for the day before and the day after.

    Why isn't this working??? And yes, there are records with that date and the records meet the other clause needs. If I take the date portion out, it works but grabs more data than I want.



    Last edited by ober0330; Nov 18th, 2004 at 10:16 AM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

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



Click Here to Expand Forum to Full Width