Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

One entry per record

Posted on 2014-03-04
4
Medium Priority
?
287 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 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 600 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 800 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 600 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

824 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