× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Matt,

You may want to look at "coalesce" as an option on your select records. You can use it to return a value instead of null. Depending upon your SQL you could return different values for the different type or null conditions.

Pete Helgren


Tyler, Matt wrote:
We have a table that records stores that are valid to receive a product.
If a product exists and the store exists then the store is valid to
receive that product. If there is no product in the table then the store
is still valid to receive the product. If the product exists and the
store does not then obviously the store cannot receive the product.


I can tell if the store is valid to receive the product if there is a
store record; however I am having trouble telling the difference between
the store not being valid because there is no product code or not being
valid because it does receive a product code. In testing the last two
cases I always get a NULL result set.

For the sample data provided assume there is another table controlling
the product numbers and there are no gaps. So for #1 (not in sample
data set) store 1 would be valid to receive, but for #8 or 11 store 1
would not be valid to receive product.

Thanks, Matt



Below is the link to SQL code to create table in question with sample
data for table.

http://code.midrange.com/8c8ef57c0f.html



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.