Select Top 20 tblCustDevices.Location
From tblCustDevices
Where tblCustDevices.Location Like 'Room 150'
Union
Select tblCompCustom.Location
From tblCompCustom
Results in 20 room numbers, including Room 150
SELECT TOP 20 tblcustdevices.location
FROM tblcustdevices
WHERE tblcustdevices.location LIKE 'Room 150'
UNION
SELECT tblcompcustom.location
FROM tblcompcustom
WHERE tblcompcustom.location LIKE 'Room 150'
Results in a single result, Room 150.
Expanding the SQL Query to:
SELECT TOP 100 tblcustdevices.location,
tblcustdevices.displayname,
tblcustdevices.model,
tblcustdevices.vendor AS [Device Vendor]
FROM tblcustdevices
WHERE tblcustdevices.location LIKE 'Room 150'
UNION
SELECT tblcompcustom.location,
tblcomputers.computerunique,
tblcomputers.DESCRIPTION,
tblcomputers.domain AS [My Domain]
FROM tblcompcustom
INNER JOIN tblcomputers
ON tblcomputers.computername = tblcompcustom.computername
WHERE tblcompcustom.location LIKE 'Room 150'
Results in: (getting closer)
Location Displayname Model Device Vendor
Room 150 Acer LCD Monitor V193W Acer
Room 150 Brother HL-4150CDN HL-4150 Brother
Room 150 Domain\COMP2\1 DOMAIN
Room 150 Domain\COMP3\1 DOMAIN
Room 150 Domain\COMP4\1 COMP4 DOMAIN
Room 150 Domain\COMP5\1 DOMAIN
Room 150 Gateway LCD Monitor FPD1730 Gateway
Room 150 Viewsonic VA2448 VA2448 Viewsonic
Room 150 Viewsonic VA2448 VA2448 SERIES Viewsonic
Room 150 WORKGROUP\NCOMP1\1 COMP1 WORKGROUP
Room 150 Zyxel 4 port Wireless Router NBG-419N Zxyel
Is it possible to have the fields from my original device by room report and my computers by room report in one single report? Or are there not enough common fields/field types in the SQL database?
Notice the data from tblcomputers.domain and tblcustdevices.vendor are unique values, but are under the same column. I'd like them each in their own column. So for a given row, tblcomputers.domain would be "DOMAIN" and tblcustdevices.vendor would be blank. And likewise, for a given row, tblcomputers.domain would be blank and tblcustdevices.vendor would be "Acer".
Thanks for getting me this far. If I can get this data in one report, that will be powerful reporting information.