I have a table that looks like this:

```
CREATE TABLE #C
(grpType varchar(10),
CPTCode varchar(10) NULL,
Month int NULL,
MTD money NULL,
MonthCount int NULL,
YTD money NULL,
YearCount int NULL,
Code varchar(10) NULL)

```

With the following data in it:

```
grpType CPTCode Month   MTD MonthCount  YTD YearCount   Code
Month   76800   5   1321.61  27       6574.54   82        76800
Month   76856   5   246.01   3        380.64    6         76856
Month   76881   5   9778.95  131          50682.59  509       76881
Month   76942   5   22467.33 190         116663.58  674       76942

```

Then I have this table:

```
CREATE TABLE #Prod
(grpType varchar(10),
TotalCharges money NULL,
TotalUnits float NULL,
RVU float NULL,
Code varchar(10) NULL,
CPTCode varchar(10) NULL)

```

With this data:

```
grpType TotalCharges    TotalUnits  RVU Code    CPTCode
Month   6100.00           12             0  76800   76800
Month   -475.00           -1             0  76880   76880
Month   38749.00      81             0  76881   76881
Month   54733.00      114            0  76942   76942

```

What I need is my end data to look like this:

```
CPTCode     MTD     TotalCharges     TotalUnits
76800       1321.61  6100.00           12
76856       246.01    NULL             NULL
76880       NULL     -475.00           -1
76881       9778.95  38749.00          81
76942       22467.33 54733.00          114

```

What would be the best join to achieve this? I have tried the left join and it doesn't work I get this result:

```
CPTCode MTD TotalCharges    TotalUnits
76800   1321.61   6100.00   12
76881   9778.95   38749.00  81
76942   22467.33  54733.00  114

```

Which excludes some of the data and that I do not want. Are there any suggestions from anyone?

Thank you

Here is the query that doesn't work:

```
 SELECT
#C.CPTCode,
#C.MTD,
#Prod.TotalCharges,
#Prod.TotalUnits
FROM  
#C
LEFT JOIN #Prod ON #C.grpType = #Prod.grpType AND #C.Code = #Prod.Code
WHERE
   (#C.CPTCode = '76800' OR #C.CPTCode = '76856' OR #C.CPTCode = '76880' OR #C.CPTCode = '76881' OR #C.CPTCode = '76942' OR #C.CPTCode = '93922')

```