ms-access


Microsoft Access returns multiple rows, but I only want to display one


I'm using Microsoft Access 2007 to query two separate SharePoint sources.
The first has most of the data I need. The unique ID number for each row in the first has a corresponding column in the second. The ID from the first can occur multiple times in the second. (It's a mapping between two different databases of defects.)first.
What I want to do is this: find all the ID's from table one that occur in the second, and list ID's from the second for each item that corresponds with the first. For starters, I want something a bit like this:
Table 1 ID Table 2 ID's
5 9, 13, 23
10 11, 15
20 8
But there's also more data from Table 1 I want to display for each item.
What I'm getting is this:
Table 1 ID Table 2 ID Table 1 Data
5 9 Row 5 Additional Data
5 13 Row 5 Additional Data
5 23 Row 5 Additional Data
10 11 Row 10 Additional Data
10 15 Row 10 Additional Data
20 8 Row 20 Additional Data
What I want is something like this:
Table 1 ID Table 2 ID's Table 1 Data
5 9, 13, 23 Row 5 Additional Data
10 11, 15 Row 10 Additional Data
20 8 Row 20 Additional Data
Or perhaps:
Table 1 ID Table 2 ID's
5 9, 13, 23
Row 5 Additional Data
10 11, 15
Row 10 Additional Data
20 8
Row 20 Additional Data
How can I create a report like that?
Comma-separated list from multiple records
Grouping of multiple data rows into a comma-separated list is not a built-in feature of Access. There are various ways to do this, but I most often see links to Allen Browne's tutorial.
Multi-line row details
The difference between your last two examples is just a matter of formatting a Form or Report in Design View. A Report (here capitalized) in Access is a specific type of object for generating custom, formatted views of your data, often for printing or read-only viewing. A Form is a dynamic, on-screen view of your data. I suspect that your use of "report" is of a more general sense.
First of all, there is no way to make multiple lines using the default Datasheet View of tables and queries. To get multiple lines per row of data, you need to create a Form or Report object in Access. In Design View, you can move the data controls around the detail area to produce multiple lines for each data row. I suggest searching for tutorials on the web for creating Access Forms and Reports.
See Guide to designing reports.

Related Links

Query access db using silverlight in an oob app with full trust?
runing a query of combinationfield in runtime,how?
Vim macro with ^M doesn't work
Infinitely looping through a recordset in VBA
Issue with the TOP 1 query
Calculating days between dates and parameters in MS Access
Alter MS Access Report output after its loaded
Is it possible to write this VBA code any better?
MS Access: Update a Linked List Box
How can I check if an instance of a Access 2010 form is still open?
How to debug a docmd.transferdatabase statement that does not work (no compiler error, simply does not xfer the data)
How to set initial selections of controls in a MS access report on its load?
Access 2000 Timeouts on bound recordset
Query to a Meaningful Report
MS Access “duplicate values” error, but I don't know why
Generate uml from vba

Categories

HOME
jdo
angular-material
rsync
survey
fsm
umd
ckeditor
session-variables
maude-system
metatrader4
modx-revolution
visual-studio-2005
graphlab
aurigma
normalizr
orleans
cloudhub
p-value
smb
brunch
greendao
web-api-testing
ping
key-value-observing
oracle-fusion-middleware
grails-3.1
catch-all
vsts-build-task
hybridauth
avcapturesession
form-data
ghost4j
overlap
unobtrusive-validation
sas-visual-analytics
eigenvalue
qcombobox
parentheses
komodoedit
jedis
pubmed
datastax-startup
typescript1.8
drupal-6
slickedit
magma
np-complete
boost-preprocessor
namecoin
epson
color-profile
firmata
angular-cache
grails-tomcat-plugin
radtreelist
thrust
ready-api
dataview
pagerank
design-by-contract
cyclomatic-complexity
vstest.console.exe
proj4js
device-orientation
csquery
tween
qcodo
device-manager
internet-connection
kgdb
ember-charts
srs
centos5
industrial
apc
opcache
excel-2003
gridcontrol
bitsharp
broken-links
objective-c-2.0
dbproviderfactories
netbeans-6.9
custom-backend
zpt
disclosure
android-sdk-2.1
floating
html-input
createwindow
suppress
jquery-ui-droppable
fixed-width
microsoft-virtualization
uimenucontroller
swing-app-framework
phonon
aquaticprime
.net-1.0

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App