Question: The DDL creates the schema and data. I am looking for a **where** statement where it returns only one row for each ID and that row would be the last inserted row based on the inserteddate column.

So the result would be John, 5 and Debbie, 5

```
select Table1.Name, Table2.Rating
From table1 join table2 on table1.ID = table2.ID
where inserteddate = max(insertedate) 

```

.. for each ID? It seems simple but I am having a brain block.

DDL:

```
CREATE TABLE [dbo].[Table1](
    [Table1ID] [int] NULL,
    [Name] [varchar](50) NULL
)

CREATE TABLE [dbo].[Table2](
    [Table2ID] [int] NULL,
    [InsertedDate] [datetime] NULL,
    [Rating] [varchar](50) NULL
)

INSERT INTO [dbo].[Table1]([Table1ID], [Name])
SELECT 1, N'John' UNION ALL
SELECT 2, N'Debbie'
INSERT INTO [dbo].[Table2]([Table2ID], [InsertedDate], [Rating])
SELECT 1, '20090101 00:00:00.000', N'6' UNION ALL
SELECT 1, '20090401 00:00:00.000', N'5' UNION ALL
SELECT 2, '20090202 00:00:00.000', N'3' UNION ALL
SELECT 2, '20090303 00:00:00.000', N'5'

```

Answer: 
I'm curious as to how Windows knows the physical size of your monitor. You must have changed a configuration somewhere? Perhaps you can change it to more convenient values that divide out nicely.

As implied by the name, a "Device Context" must be connected to a system device. However this does not need to be a hardware driver, it could be a device emulator such as a PDF writer print driver. I've seen at least one that lets you set an arbitrary DPI.
Note that I run with 120 dpi on WXP all the time (large fonts) which means metafileGraphics.DpiX will be returning 120.

The EMF file does not appear to record what the dpi was of the reference context (120 in this case, 96 for most other people).

To make things more interesting, it is possible to create an EMF via drawing onto an in memory bitmap that has had SetResolution() set to, say, 300dpi. In that case, I believe the scaling factor has to be 300 and not what the monitor (86.x) or Windows (120) might be using.