Jumat, 04 November 2011

Re: [MS_AccessPros] Query showing duplicates.

 

Thank you! That did the trick. Now, remember the query we did together that combined the Assets & Contacts? That query was messed up to this morning.  I went back and copied the sql you created for me and pasted it in to the SQL view, but it did not fix the problem.
 
SELECT Contacts.ID, Contacts.LastName, Contacts.FirstName, Contacts.EmailAddress, Contacts.Department, Contacts.[Office Phone], Contacts.[Mobile Phone], Contacts.FaxNumber, Contacts.Supervisor, Assets.Unit, Assets.[Last Month], Assets.Current, Assets.CO, Assets.[Acc Code], Assets.[Well No], Assets.Model, Assets.Year, Assets.Description, Assets.[Vin#], Assets.License, Assets.Acquired, Assets.Weight, Assets.Supervisor, Assets.Images, Assets.Retired, Assets.Total, Assets.Sold, Assets.Notes
FROM Assets RIGHT JOIN Contacts ON Assets.[Mobile Phone] = Contacts.[Mobile Phone];
 
It is only showing the contact detail and not the Assets detail.  Can you help me with this?
 

Tiffany Atchley

________________________________
From: John Viescas <john@viescas.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Friday, November 4, 2011 9:31 AM
Subject: RE: [MS_AccessPros] Query showing duplicates.

 
Tiffany-

It looks like the Images field is Attachment data type, correct? Any asset that
has more than one image saved will show multiple rows because the multiple
attachments are stored in a hidden table. When you include ask for the
individual properties of the attachment field (FileData, FileFlags, FileName,
FileTimeStamp, FileType), you're effectively doing a 1 to many join to the
hidden table. Remove those "property" fields to see one row per asset.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of cc0623
Sent: Friday, November 04, 2011 3:33 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Query showing duplicates.

Does anyone know why this is happening? The table is fine, but the query is
showing duplicates of every record.

SELECT Assets.[Unit], Assets.[Last Month], Assets.[Current], Assets.[CO],
Assets.[Acc Code], Assets.[Well No], Assets.[Model], Assets.[Year],
Assets.[Description], Assets.[Driver], Assets.[Mobile Phone],
Assets.[Department], Assets.[Vin#], Assets.[License], Assets.[Acquired],
Assets.[Fuel], Assets.[Weight], Assets.[Supervisor], Assets.[Images],
Assets.[Images].[FileData], [Images].[FileFlags] AS Expr1,
Assets.[Images].[FileName], [Images].[FileTimeStamp] AS Expr2,
Assets.[Images].[FileType], [Images].[FileURL] AS Expr3, Assets.[Retired],
Assets.[Total], Assets.[Sold], Assets.[Notes]
FROM Assets;

Tiffany

------------------------------------

Yahoo! Groups Links

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar