Solved

One entry per record

Posted on 2014-03-04
4
270 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
4 Comments
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

864 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now