Link to home
Start Free TrialLog in
Avatar of bejhan
bejhan

asked on

SQL Query Problem

I have written the below query to select items from tblItems which have different balances than their counter parts in stblBalances. However, as you can see in the picture it is pulling up records with balances that should match. In both tables the balance fields are the same (Type: Double, Format: Fixed, Decimal Places: 3).

Why is this not pulling up the correct results?
SELECT a.ItemID, a.Balance, b.Balance, a.RequiresReview, a.Category, a.Completed
FROM tblItems AS a, stblBalances AS b
WHERE a.ItemID = b.ItemID AND a.Balance <> b.Balance

Open in new window

balances.bmp
ASKER CERTIFIED SOLUTION
Avatar of ralmada
ralmada
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bejhan
bejhan

ASKER

Ah shoot I should have known, I was having a similar problem with conditional formatting. I just figured SQL would be able handle that problem. Thanks!
Avatar of Guy Hengel [angelIII / a3]
rounding, I presume.
the display is rounded, but the values do indeed not match

round(a.Balance) <> round(b.Balance)

Open in new window