473,320 Members | 1,861 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,320 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 1164
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.