Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Record not showing

Author  Topic 

Yonkouturko
Yak Posting Veteran

59 Posts

Posted - 2012-12-20 : 03:37:48
im having problems in my query i dont know if whats wrong with this...
i have records that has status's
compare records with null values to be shown....

SELECT ReferenceNumber, PO_Number, SalesRepresentative, Status, Delivery_Status, Date, ApprovedBy, Supplier, CreatedBy, Terms, Type_of_Payment, Modes_of_Payment, Priority_Level,
CollectionDate, DeliveryDate, CreatedDate, SO_Number, Remarks, TotalAmount

FROM Table_PurchaseOrder_Information

WHERE Status in ('For Approval','Approved') AND Delivery_Status = NULL


in this sql ... the DELIVERY_STATUS has NULL VALUES
but records is now showing ....


please help

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2012-12-20 : 04:22:25
Delivery_Status IS NULL



--
Chandu
Go to Top of Page

Yonkouturko
Yak Posting Veteran

59 Posts

Posted - 2012-12-20 : 04:52:35
IT WORKED AGAIN BANDI!!!
YOUR SUCH A HEAVEN SENT TO ME!!! THANK YOU SO MUCH!!!!
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2012-12-20 : 06:44:39
quote:
Originally posted by Yonkouturko

IT WORKED AGAIN BANDI!!!
YOUR SUCH A HEAVEN SENT TO ME!!! THANK YOU SO MUCH!!!!


That was simple mistake.. no problem...
However, you are welcome

--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-12-20 : 07:59:59
Just if you're interested, reason is under default conditions specified by ANSI NULL settings, NULL is not regarded as a value by itself in sql server. It just represents a condition Unknown value. Hence all other operators like =,<>,>,< etc ignore NULL values. you need to use IS NULL or IS NOT NULL for null related checks.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Yonkouturko
Yak Posting Veteran

59 Posts

Posted - 2012-12-20 : 21:56:00
@visakh16
thank you for the wonderful information ! i appreciate your lecture to me sir since im just a beginner in programming field!!
i hope you can help me out in future problems i will encounter... so that i can pass/share your knowledge to other beginners!!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-12-21 : 00:47:48
quote:
Originally posted by Yonkouturko

@visakh16
thank you for the wonderful information ! i appreciate your lecture to me sir since im just a beginner in programming field!!
i hope you can help me out in future problems i will encounter... so that i can pass/share your knowledge to other beginners!!


welcome
Sure...post whenever you're in doubt and I'll help out with whatever I can with explanation

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -