A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Displaying One Record



 
 
Thread Tools Display Modes
  #1  
Old May 14th, 2007, 03:55 PM posted to microsoft.public.access.reports
chris
external usenet poster
 
Posts: 2,039
Default Displaying One Record

I have the following SQL code in a report. In the Tbl_Inspection_Phases
table, a [Prop Code] may be listed multiple times with either the same or
different [Due Date]. If a [Prop Code] has [Due Date] that are the same, I
would like only one of the [Prop Code] to print on the report. If the [Due
Date] are differnt for the same [Prop Code], then both [Prop Code] should
print. Thanks

SELECT Tbl_Hotels.[Project Manager], Tbl_Inspect.Status, Tbl_Hotels.[PM on
Hold], Tbl_Hotels.[Prop Code], Tbl_Hotels.[Property Name],
Tbl_Inspection_Phases.Type, Tbl_Inspection_Phases.[Due Date],
Tbl_Inspection_Phases.Phase, Tbl_Inspection_Phases.[Inpsection Date],
Tbl_Inspection_Phases.Variance
FROM (Tbl_Hotels INNER JOIN Tbl_Inspect ON Tbl_Hotels.ID =
Tbl_Inspect.[Hotel ID]) INNER JOIN Tbl_Inspection_Phases ON
Tbl_Inspect.InspectionID = Tbl_Inspection_Phases.[Inspection ID]
WHERE (((Tbl_Inspect.Status)="Reno") AND ((Tbl_Hotels.[PM on Hold])=False));

  #2  
Old May 15th, 2007, 12:12 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default Displaying One Record

Try adding the keyword DISTINCT to your query.

SELECT DISTINCT Tbl_Hotels.[Project Manager]
, Tbl_Inspect.Status
, Tbl_Hotels.[PM on Hold]
, Tbl_Hotels.[Prop Code]
, Tbl_Hotels.[Property Name] ...

IF that does not give you the desired result then post back with an example
of what you are getting now and what you want to see.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Chris" wrote in message
...
I have the following SQL code in a report. In the Tbl_Inspection_Phases
table, a [Prop Code] may be listed multiple times with either the same or
different [Due Date]. If a [Prop Code] has [Due Date] that are the same,
I
would like only one of the [Prop Code] to print on the report. If the
[Due
Date] are differnt for the same [Prop Code], then both [Prop Code] should
print. Thanks

SELECT Tbl_Hotels.[Project Manager], Tbl_Inspect.Status, Tbl_Hotels.[PM on
Hold], Tbl_Hotels.[Prop Code], Tbl_Hotels.[Property Name],
Tbl_Inspection_Phases.Type, Tbl_Inspection_Phases.[Due Date],
Tbl_Inspection_Phases.Phase, Tbl_Inspection_Phases.[Inpsection Date],
Tbl_Inspection_Phases.Variance
FROM (Tbl_Hotels INNER JOIN Tbl_Inspect ON Tbl_Hotels.ID =
Tbl_Inspect.[Hotel ID]) INNER JOIN Tbl_Inspection_Phases ON
Tbl_Inspect.InspectionID = Tbl_Inspection_Phases.[Inspection ID]
WHERE (((Tbl_Inspect.Status)="Reno") AND ((Tbl_Hotels.[PM on
Hold])=False));



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.