Results 1 to 3 of 3

Thread: SQL Problems

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Location
    Pittsburgh, PA
    Posts
    149

    SQL Problems

    I am trying to run this sql statement:
    Code:
    SELECT min(distinct(a.id)) FROM TBL_NOTEBOOK AS a WHERE Item_Type=1 
    AND a.id<>(SELECT d.id FROM tbl_notebook as d inner join tbl_checkout 
    as e on e.item_id=d.id  WHERE (d.item_type=1)  AND (e.returned=0)AND
    (((@date1>=e.date_out_res) AND (@date2>=e.date_out_res)) OR 
    ((@date1<=e.date_in_res) AND (@date2<=e.date_in_res))))
    The problem occurs when the imbedded select returns nothing then the final result is null. Is there any way to prevent that?

  2. #2
    Member
    Join Date
    Feb 2001
    Location
    Clifton Park, NY
    Posts
    42
    I heard somewhere where you can run into problem using an inner join when thier are no records being selected.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Location
    Pittsburgh, PA
    Posts
    149
    I'll work on a way around that then. Thanks

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