Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Not Returning All Data 1

Status
Not open for further replies.

carpetbelly

Technical User
Jun 12, 2003
202
GB
Just using the standard query builder in access the SQL I get is the following

Code:
SELECT tblData.OriginatorName, tblData.DateIncidentRaised, tblData.IssueTitle, tblData.System, tblData.IncidentStatus
FROM tblData
WHERE (((tblData.IncidentStatus)<>"Closed"));
Now this just doesn't return any data I have in the table tblData.

if I remove the where clause then it returns all the data as you'd expect. Obv it's the where clause that's going wrong but my SQL is rather rusty lately. Anyone able to give some advice?
 
Does IncidentStatus hold only two values: "Closed" or Null ?
You may try the following SQL code:
SELECT tblData.OriginatorName, tblData.DateIncidentRaised, tblData.IssueTitle, tblData.System, tblData.IncidentStatus
FROM tblData
WHERE Nz(tblData.IncidentStatus,"")<>"Closed";

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

How about...
Code:
WHERE tblData.IncidentStatus) Not Like "*Closed*"


Randy
 
Thankyou both for the ideas... Much appreciated. The joys of being rusty with my SQL is embaressing =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top