A similar question has recently been asked on this thread. However, I want to know if there is a way to get around it. I am using Microsoft Access 2013 to create a database of computer equipment that our users have at my workplace. I have a query that searches by their user name and outputs their equipment. However, when the user has more than one type of equipment in one table, the results from previous tables repeat themselves to compensate for this extra piece of equipment.
I am wondering if there is a way to get around this, where the additional rows due to multiple items of the same type are blank for fields that already have a value in the first row. Here is the layout of my database so far:
Table: Users
- Username
- Last Name
- First Name
Table: Desktops
- Model Number
- Serial Number
Table: Mobile Devices
- Model Number
- Serial Number
So, for example, if person with the username jdoe has one desktop, and one mobile device, the query will output all of his equipment in one row as desired. However, if jdoe gets a second laptop, the query will have all the equipment and his first laptop in row one and the same equipment and his second laptop in row two.
I understand why Access does this, I am just wondering if there is a way to get around this. Here is the SQL code:
Any thoughts? Thanks so much.Code:SELECT Desktops.[Brand/Type/Model Number], Printers.[Brand/Type/Model Number], [Mobile Devices].[Brand/Type/Model Number], [Docking Stations].[Brand/Type/Model Number], [Home Use].[Brand/Type/Model Number], Miscellaneous.[Brand/Type/Model Number] FROM ((((((Users LEFT JOIN Desktops ON Users.Username = Desktops.Owner) LEFT JOIN [Docking Stations] ON Users.Username = [Docking Stations].Owner) LEFT JOIN [Home Use] ON Users.Username = [Home Use].Owner) LEFT JOIN Miscellaneous ON Users.Username = Miscellaneous.Owner) LEFT JOIN [Mobile Devices] ON Users.Username = [Mobile Devices].Owner) LEFT JOIN Printers ON Users.Username = Printers.Owner) LEFT JOIN [Virtual Machines] ON Users.Username = [Virtual Machines].Owner WHERE (((Users.Username)=[Enter Username]));