Solved

One entry per record

Posted on 2014-03-04
4
279 Views
Last Modified: 2014-03-06
I need a query that will only find only one (1) entry in the record where the Descvalue field is "Hot Tap Clamps - Exempt".
One-Entry.bmp
0
Comment
Question by:donnie91910
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 150 total points
ID: 39905112
try this


SELECT tbl_x.facilityID, Count(tbl_x.facilityID) AS CountOffacilityID, tbl_x.Descvalue
FROM tbl_x
GROUP BY tbl_x.facilityID, tbl_x.Descvalue
Having (((Count(tbl_x.facilityID))=1) AND ((tbl_x.Descvalue)="Hot Tap Clamps - Exempt"))
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 200 total points
ID: 39905174
How about this:
SELECT A.FacilityID 
FROM TableName As A INNER JOIN (SELECT FacilityID, Count(FacilityID) AS CountID
FROM TableName
GROUP BY FacilityID) As B ON A.FacilityID = B.FacilityID
WHERE A.Descvalue="Hot Tap Clamps - Exempt" And B.CountID=1

Open in new window

Ron
0
 
LVL 7

Assisted Solution

by:COACHMAN99
COACHMAN99 earned 150 total points
ID: 39905256
why not use TOP?
e.g.
SELECT TOP 1 Tx.TX_Description, Tx.Cust_ID FROM Tx WHERE (((Tx.Cust_ID)=78));
0
 

Author Closing Comment

by:donnie91910
ID: 39911410
Thank you.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question