
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2009 07:02 PM
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?
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?
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2009 09:11 PM
Right click on the link between the tables.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2009 09:07 PM
That seems to have fixed it.
Is there a way to do that through the report builder?
Is there a way to do that through the report builder?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2009 08:24 PM
Problem is the join, change to this:
"FROM tblComputers LEFT OUTER JOIN"
"FROM tblComputers LEFT OUTER JOIN"

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2009 06:19 PM
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
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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2009 11:11 AM
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"
Most likely your "join" is wrong and you need to select "display all results from tblcomputers"
