RE: sql server empty fields
MB Software Solutions wrote: Stephen the Cook wrote: Judith Barer wrote: What would you use in an sql select statement for sql server to replace empty() function of vfp. I would like to do the following in t-sql Select items.item_num , iif(!empty(addl_loc_info),.t.,.f.) Is it null? If so you have isNull() or Nullif() You will also return False/True or 0/1 for your logical sample above. Select ISNULL( addl_loc_info , false ) From yourtable I don't have BooksOnline locally to reference right now, but isn't there an ISBLANK function that may work as well, or is that just with ASP? Not an M$ function. Java yes, M$ nope. Stephen Russell DBA / .Net Developer Memphis TN 38115 901.246-0159 A good way to judge people is by observing how they treat those who can do them absolutely no good. ---Unknown http://spaces.msn.com/members/srussell/ -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.17.17/661 - Release Date: 1/30/2007 11:30 PM ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: sql server empty fields
What would you use in an sql select statement for sql server to replace empty() function of vfp. I would like to do the following in t-sql Select items.item_num , iif(!empty(addl_loc_info),.t.,.f.) I never messed with it a lot, so there's probably a better way, but I just test against an empty value. eg, Addl_loc_info = ' ', ncost = 0.00, etc. Need 1 space between the quotes in the first example, as an empty string '' doesn't work. ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
sql server empty fields
What would you use in an sql select statement for sql server to replace empty() function of vfp. I would like to do the following in t-sql Select items.item_num , iif(!empty(addl_loc_info),.t.,.f.) So I see that you need to use case instead of iif but I do not know what to use instead of empty(). When I tries is not null it returned everything. Thanks Judith Judith Barer Star-K Kosher Certification 122 Slade Ave Baltimore, MD 21208 410 484 4110 Fax 410 653 9293 --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
RE: sql server empty fields
Judith Barer wrote: What would you use in an sql select statement for sql server to replace empty() function of vfp. I would like to do the following in t-sql Select items.item_num , iif(!empty(addl_loc_info),.t.,.f.) Is it null? If so you have isNull() or Nullif() You will also return False/True or 0/1 for your logical sample above. Select ISNULL( addl_loc_info , false ) From yourtable HTH Stephen Russell DBA / .Net Developer Memphis TN 38115 901.246-0159 A good way to judge people is by observing how they treat those who can do them absolutely no good. ---Unknown http://spaces.msn.com/members/srussell/ -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.17.17/661 - Release Date: 1/30/2007 11:30 PM ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: sql server empty fields
Stephen the Cook wrote: Judith Barer wrote: What would you use in an sql select statement for sql server to replace empty() function of vfp. I would like to do the following in t-sql Select items.item_num , iif(!empty(addl_loc_info),.t.,.f.) Is it null? If so you have isNull() or Nullif() You will also return False/True or 0/1 for your logical sample above. Select ISNULL( addl_loc_info , false ) From yourtable I don't have BooksOnline locally to reference right now, but isn't there an ISBLANK function that may work as well, or is that just with ASP? -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.