cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
QNS
Engaged Sweeper
We're using custom fields to track internal ownership of equipment.

Currently I have the following query which shows me all computers added in the last 14 days:

SELECT TOP 1000
tblComputers.Computername,
convert(varchar(10), tblComputers.Firstseen, 101) AS [Added Date],
convert(varchar(10), tblComputers.Lastseen, 101) AS [Last Scanned]
FROM
tblComputers
WHERE
tblComputers.Firstseen >= DATEADD([day], -14, GETDATE())
ORDER BY
tblComputers.Firstseen DESC,
tblComputers.Computername


If I attempt to add any fields from the CompCustom table, it will display the computer, if the custom fields have been edited.

If the custom fields have not been touched, they are excluded.

The purpose of this report is to find new machines so I can add custom field entries.

I have found this behaviuor in other reports as well.

Any ideas?
5 REPLIES 5
Hemoco
Lansweeper Alumni
Right click on the link between the tables.
QNS
Engaged Sweeper
That seems to have fixed it.

Is there a way to do that through the report builder?
Hemoco
Lansweeper Alumni
Problem is the join, change to this:

"FROM tblComputers LEFT OUTER JOIN"
QNS
Engaged Sweeper
If I run the first query, I get 8.

If I run this one, I get 7.


SELECT TOP 1000
tblComputers.Computername,
convert(varchar(10), tblComputers.Firstseen, 101) AS [Added Date],
convert(varchar(10), tblComputers.Lastseen, 101) AS [Last Scanned],
tblCompCustom.Department,
tblCompCustom.Building,
tblCompCustom.Location
FROM
tblComputers
INNER JOIN tblCompCustom ON (tblComputers.Computername = tblCompCustom.Computername)
WHERE
tblComputers.Firstseen >= DATEADD([day], -14, GETDATE())
ORDER BY
tblComputers.Firstseen DESC,
tblComputers.Computername
Hemoco
Lansweeper Alumni
Could you post your full query (with the custom fields table)
Most likely your "join" is wrong and you need to select "display all results from tblcomputers"