开发者

Problem filtering in decimal datatype in Sql server

I want to fetch al开发者_StackOverflowl the records that have null in openingbalance field of my voucher table in sql server 2005 database. That field is of type decimal(18,0). My query is

Select HeadCode,HeadName
from VoucherHead
where OpeniningBalanace = null

what am i doing wrong?


You have to check for null using IS, rather than =

Select HeadCode,HeadName
from VoucherHead
where OpeniningBalanace IS null


Hence the little difference:

Select HeadCode,HeadName
from VoucherHead
where OpeniningBalanace IS NULL
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜