Query returning nulls when there is data

  • I am getting nulls in my result set when I know the data exist.

    Using SQl Server7(sp3)

    Select name, date, dept from table

    where

    date between '2/2/02' and '2/4/02'

    and dept = red

    Now if I do a select * from the table or just use the date portion of the where I get values back in the dept column. Has anyone encountered this and have any suggestions?

    TIA

    Yvonne

  • Try

    Select name, date, dept from table

    where

    (date between '2/2/02' and '2/4/02')

    and dept = 'red'

    You should always put between statements in () to make sure parses correctly.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanks for the suggestion. I still get the nulls.

  • Maybe I am missing something, can you post an example of what you get as the output. Also please post the table DDL so I can see what happens here please?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply