![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
The query: SELECT BTbl.PKey, BTbl.Result FROM BTbl INNER JOIN ATbl ON BTbl.PKey = ATbl.PKey WHERE (ATbl.Status = 'DROPPED') AND (BTbl.Result <> 'RESOLVED') Returns no rows. If I do: SELECT BTbl.PKey, BTbl.Result FROM BTbl INNER JOIN ATbl ON BTbl.PKey = ATbl.PKey WHERE (ATbl.Status = 'DROPPED') Returns: PKey Result 125 127 RESOLVED I want the first query to return the row with PKey: 125 because it's result field does not equal 'RESOLVED' Any ideas what I'm doing wrong? My tables: CREATE TABLE [dbo].[ATbl] ( [PKey] [int] NOT NULL , [Status] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[BTbl] ( [PKey] [int] NOT NULL , [Result] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO |
![]() |
| Thread Tools | |
| Display Modes | |
| |