473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

sql queries 2 datagrids

I have a table that contains customers, and another table that has customers
and items they are authorized for.

I would like to show a datagrid (1) with customers that are authorized for a
select item the user choose, and datagrid (2) that shows which customers are
not in that table for that item. The datagrid2 is the one that I am confused
with. The table can contain many items for many stores. So I had the
query:

SELECT store, itemnum
FROM tblCustomers LEFT OUTER JOIN
tblAuthorized ON tblCustomers.Num = tblAuthorized.store
WHERE (tblAuthorized.store IS NULL) AND (tblAuthorized.itemnum = '120027')

This returns no stores?

If I select the itemnumber in a view that connects to this query, so there
is no tblAuthorized.itemnum = '120027', just querying a view of stores that
have that specific itemnumber.

Any way to send a store number to a view and then connect that view (stores
with certain item) to do an outer join with tblCustomers to get those that
are missing with that item?

Thanks for any help.
Jul 21 '05 #1
1 1167
Don't use a Join for this unless you are 100% positive you don't want to use
a DataAdapter for your updates - and even then I'd avoid it. Use a
DataRelation and two separate queries, two separate adapters - life will be
SOOO much better for you .
http://www.knowdotnet.com/articles/datarelation.html
"AshleyT" <As*****@discussions.microsoft.com> wrote in message
news:E3**********************************@microsof t.com...
I have a table that contains customers, and another table that has customers and items they are authorized for.

I would like to show a datagrid (1) with customers that are authorized for a select item the user choose, and datagrid (2) that shows which customers are not in that table for that item. The datagrid2 is the one that I am confused with. The table can contain many items for many stores. So I had the
query:

SELECT store, itemnum
FROM tblCustomers LEFT OUTER JOIN
tblAuthorized ON tblCustomers.Num = tblAuthorized.store
WHERE (tblAuthorized.store IS NULL) AND (tblAuthorized.itemnum = '120027')
This returns no stores?

If I select the itemnumber in a view that connects to this query, so there
is no tblAuthorized.itemnum = '120027', just querying a view of stores that have that specific itemnumber.

Any way to send a store number to a view and then connect that view (stores with certain item) to do an outer join with tblCustomers to get those that
are missing with that item?

Thanks for any help.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: morgal | last post by:
Well, I'll look into my crystal ball and tell you what I've experienced according to your lack of description of your problem and error codes: 1st make 1 recordset per databinding. I'll assume...
4
by: ree32 | last post by:
I have a placeholder and depending on a user input(a drop downlist) when the user clicks a button I dynamically create a number of datagrids and fill them with data from a database. But the problem...
0
by: Scott Meddows | last post by:
I'm having trouble scrolling some datagrids so they sync up... I have two identical datagrids on a form, filled with eh same dataset. I want a user to be able to scroll on the datasets and the...
1
by: AshleyT | last post by:
I have a table that contains customers, and another table that has customers and items they are authorized for. I would like to show a datagrid (1) with customers that are authorized for a...
3
by: Mark Wiewel | last post by:
hi all, i am a newbie in ASP.NET and i couldn't find the solution to this one: i have a form with three datagrids on it. i would like to align them vertically with a space between each grid of...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
0
by: Jim | last post by:
OK here's my disclaimer: I'm very new to ASP.NET and posting on Google Groups, so please bear with me and feel free to correct either the way I code or the way I post. I have an ASP.NET page...
1
by: =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post by:
Hi, I am using the code below to export a webpage to Excel. The webpage has three datagrids on it and they are all exported to Excel properly and everything looks very nice, but we would really...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.