• Ok so in this case, there were zero payments made for the first query. The query does not find any results, so it says the result is NULL.

    First Query

    Select SUM(ISNULL(Amount, 0)) From Contracts.dbo.Paymenthistory

    where Contracts.dbo.Paymenthistory.Billdesc like '%Credit Card%'

    and Contracts.dbo.Paymenthistory.Receivedate >= '6/30/2012 00:00:00'

    and Contracts.dbo.Paymenthistory.Receivedate <= '6/30/2012 23:59:59'

    and Contracts.dbo.Paymenthistory.amount !< '0'

    and Contracts.dbo.Paymenthistory.BillDesc not like '%Reapplied%'

    Results: NULL

    (No payments made on june 30th 2012: No Results. If it were Select * From... then it would have no results)

    The second query:

    Select SUM(ISNULL(Amount, 0)) From Phase1.dbo.Paymenthistory

    where Phase1.dbo.Paymenthistory.Billdesc like '%Credit Card%'

    and Phase1.dbo.Paymenthistory.Receivedate >= '6/30/2012 00:00:00'

    and Phase1.dbo.Paymenthistory.Receivedate <= '6/30/2012 23:59:59'

    and Phase1.dbo.Paymenthistory.amount !< '0'

    and Phase1.dbo.Paymenthistory.BillDesc not like '%Reapplied%'

    Results: 7500.74

    And if you change this query to say Select * From.... then the results for the Amount column are below which adds up to 7500.74. Thats 152 different payments adding up to 7500.74

    45.97

    88.21

    41.19

    57.61

    58.30

    50.05

    28.70

    35.72

    32.52

    31.54

    52.35

    67.37

    36.28

    35.95

    28.83

    42.19

    60.46

    79.97

    35.86

    62.95

    40.96

    60.27

    32.72

    109.21

    122.90

    44.77

    39.30

    45.00

    43.35

    47.66

    31.19

    28.87

    79.84

    136.96

    4.95

    50.52

    9.34

    125.70

    70.57

    32.53

    81.47

    97.31

    35.26

    68.49

    88.68

    6.43

    26.04

    39.84

    30.56

    105.19

    76.59

    8.05

    41.88

    34.39

    67.27

    36.13

    31.43

    22.97

    42.32

    52.44

    32.78

    29.45

    34.92

    33.55

    2.45

    32.23

    0.01

    55.67

    38.12

    37.62

    12.63

    44.10

    52.50

    38.58

    93.11

    57.52

    67.87

    43.49

    40.68

    38.81

    60.63

    47.78

    100.00

    79.74

    36.63

    41.71

    79.95

    54.86

    40.91

    95.19

    28.67

    60.87

    47.56

    5.17

    79.95

    43.38

    29.97

    33.21

    35.45

    51.85

    47.80

    35.41

    35.84

    35.21

    50.43

    31.85

    51.14

    28.69

    35.48

    50.66

    41.01

    49.98

    41.04

    27.34

    38.89

    17.66

    41.65

    50.33

    45.80

    30.38

    34.18

    38.44

    38.55

    62.79

    16.37

    36.93

    37.88

    47.74

    53.44

    59.95

    30.25

    39.07

    40.13

    46.57

    37.07

    114.36

    86.83

    47.37

    29.38

    109.21

    65.95

    73.06

    41.87

    42.95

    117.36

    28.67

    41.33

    100.00

    97.36

    43.37

    30.81

    63.97

    Now If I were to add both queries together, it would say that NULL + 7500.74 = NULL which is my problem. I want it to know that there were zero payments made in the first query which in turn means the the amount is zero not NULL. I want it to say 0 + 7500.74 = 7500.74. IF THIS HELPS I'm not sure if I need to somehow convert the amount column to something else. The direct Object Explorer says that the amount column is this: Amount (decimal(18,2), null). There will be no amounts that = 0 in the actual data. I just want the sum of zero payments to = 0. Is this possible?