SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Record not showing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yonkouturko
Yak Posting Veteran

Philippines
59 Posts

Posted - 12/20/2012 :  03:37:48  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2215 Posts

Posted - 12/20/2012 :  04:22:25  Show Profile  Reply with Quote
Delivery_Status IS NULL



--
Chandu
Go to Top of Page

Yonkouturko
Yak Posting Veteran

Philippines
59 Posts

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

bandi
Flowing Fount of Yak Knowledge

India
2215 Posts

Posted - 12/20/2012 :  06:44:39  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 12/20/2012 :  07:59:59  Show Profile  Reply with Quote
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

Philippines
59 Posts

Posted - 12/20/2012 :  21:56:00  Show Profile  Reply with Quote
@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

India
52317 Posts

Posted - 12/21/2012 :  00:47:48  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000