SQL
USE [PrintMonitor]
GO
/****** Object:  View [dbo].[PRINTED DOCUMENTS]    Script Date: 10/15/2008 21:58:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[PRINTED DOCUMENTS]
AS
SELECT DISTINCT 
                      TOP (100) PERCENT dbo.[Print Jobs].[User name], dbo.[Print Jobs].[Document Name], dbo.[Print Jobs].Submitted, dbo.Printers.Name AS [Printer Name], 
                      dbo.[Print Jobs].[Machine Name], dbo.[Print Jobs].Pages, dbo.[Print Jobs].[Paper Type], dbo.[Print Jobs].[Pages Printed], dbo.[Print Jobs].Landscape, 
                      dbo.[Print Jobs].Colour, dbo.[Print Jobs].[Paper Source], ISNULL(dbo.[Standard Paper Sizes].Width, dbo.[Print Jobs].[Paper Width]) AS Width, 
                      ISNULL(dbo.[Standard Paper Sizes].Height, dbo.[Print Jobs].[Paper Height]) AS Height, ISNULL(dbo.[Standard Paper Sizes].[Measurement Units], 
                      'Millimeters') AS [Measurement Units]
FROM         dbo.[Print Jobs] INNER JOIN
                      dbo.Printers ON dbo.[Print Jobs].[Printer Id] = dbo.Printers.Id LEFT OUTER JOIN
                      dbo.[Standard Paper Sizes] ON dbo.[Print Jobs].[Paper Type] = dbo.[Standard Paper Sizes].[Paper Size Name]
ORDER BY dbo.[Print Jobs].[User name], dbo.[Print Jobs].Submitted, [Printer Name]

Last edited Oct 15, 2008 at 8:59 PM by Merrion, version 1

Comments

No comments yet.