Ask a Question related to ASP, Design and Development.
-
DebbieD #1
Data Grid or Data Matrix...
Greetings,
This seems a very complicated task, so I welcome any
input. My boss wants a data grid or matrix of the top 6
orders with ordered items, and products, for a particular
customer and he wants to see it like this:
products down the left side
orders across the top
number of items under the respective order number column
across from the corresponding product.
I hope that makes sense.
I have three tables. Products, Orders, Orderitems. I
don't even know where to start. Many thanks in advance
for any input offered.
DebbieD Guest
-
Problem with Data Grid reading dynamic data
I have created a website that uses datagrids to read data from an asp page. It works great, and fills the datagrid perfectly but it does not work... -
How to display a set of data in a data grid when drivenby a combo box?
I am trying to build a page where the user can select a syle of food (i.e. chinese, italian etc) from a combo. I would then want the relevent... -
How to append data in data grid from response
I am displaying the data say 10 records in the data grid from the HTPPResponse. I am having button below the data grid named " more". When user... -
Drag and drop data between cells in a data grid
Check out this, dino has explained how to do drag and drop in datagrid http://msdn.microsoft.com/msdnmag/issues/04/01/CuttingEdge/default.aspx --... -
Display data from database in a scrollable data grid on an ASP Page
Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to... -
Bob Barrows #2
Re: Data Grid or Data Matrix...
DebbieD wrote:
So you need a crosstab (also known as a pivot table). The first step is to> Greetings,
>
> This seems a very complicated task, so I welcome any
> input. My boss wants a data grid or matrix of the top 6
> orders with ordered items, and products, for a particular
> customer and he wants to see it like this:
> products down the left side
> orders across the top
> number of items under the respective order number column
> across from the corresponding product.
> I hope that makes sense.
> I have three tables. Products, Orders, Orderitems. I
> don't even know where to start. Many thanks in advance
> for any input offered.
let us know what database you are using (version, as well). Also, if you
could give us some details about your tables, column names, datatypes,
relationships, it would get us that much further along in the process. Note,
if your tables have dozens of columns that aren't related to this question,
then we don't need to hear about them, just tell us about the relevant
columns and their datatypes.
Providing some sample data for us to work with will also help. Just a few
rows for each table - no need to use attachments.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
debbied #3
Re: Data Grid or Data Matrix...
Many thanks Bob. I am using a SQL2000 database.
I have three tables and have listed fields I need to
display next to the table name:
PRODUCTS - catalogid (int),name (text)
orders - orderid (int), lastname (text), firstname (text)
orderitems - numitems (int), unitprice (money)
orderitems is linked to orders with orderid
products is linked to orderitems with catalogid
I hope this helps. In the meantime, I'll look up things
on pivot tables.
Thanks again.
6>-----Original Message-----
>DebbieD wrote:>> Greetings,
>>
>> This seems a very complicated task, so I welcome any
>> input. My boss wants a data grid or matrix of the topparticular>> orders with ordered items, and products, for acolumn>> customer and he wants to see it like this:
>> products down the left side
>> orders across the top
>> number of items under the respective order numberThe first step is to>>> across from the corresponding product.
>> I hope that makes sense.
>> I have three tables. Products, Orders, Orderitems. I
>> don't even know where to start. Many thanks in advance
>> for any input offered.
>So you need a crosstab (also known as a pivot table).well). Also, if you>let us know what database you are using (version, asnames, datatypes,>could give us some details about your tables, columnin the process. Note,>relationships, it would get us that much further alongrelated to this question,>if your tables have dozens of columns that aren'tabout the relevant>then we don't need to hear about them, just tell ushelp. Just a few>columns and their datatypes.
>
>Providing some sample data for us to work with will alsospam trap so I>rows for each table - no need to use attachments.
>
>Bob Barrows
>
>--
>Microsoft MVP - ASP/ASP.NET
>Please reply to the newsgroup. This email account is mythen remove the>don't check it very often. If you must reply off-line,>"NO SPAM"
>
>
>.
>debbied Guest
-
DebbieD #4
Re: Data Grid or Data Matrix...
Hi Bob,
I did exactly what I need in Access but it won't work in
my Active Server Page because my back end is SQL. How
can I translate this into a SQL query? Thanks!
Hello,
I've created this crosstab query in Access and works
great but my back end is SQL2000. How can this be
rewritten to pull from a SQL2000 database in an ASP?
Thank you very much in advance.
TRANSFORM Sum(qyMatrixTest.numitems) AS SumOfnumitems
SELECT qyMatrixTest.cname
FROM qyMatrixTest
WHERE (((qyMatrixTest.ocustomerid)=271))
GROUP BY qyMatrixTest.cname, qyMatrixTest.ocustomerid
PIVOT qyMatrixTest.orderid;
6>-----Original Message-----
>DebbieD wrote:>> Greetings,
>>
>> This seems a very complicated task, so I welcome any
>> input. My boss wants a data grid or matrix of the topparticular>> orders with ordered items, and products, for acolumn>> customer and he wants to see it like this:
>> products down the left side
>> orders across the top
>> number of items under the respective order numberThe first step is to>>> across from the corresponding product.
>> I hope that makes sense.
>> I have three tables. Products, Orders, Orderitems. I
>> don't even know where to start. Many thanks in advance
>> for any input offered.
>So you need a crosstab (also known as a pivot table).well). Also, if you>let us know what database you are using (version, asnames, datatypes,>could give us some details about your tables, columnin the process. Note,>relationships, it would get us that much further alongrelated to this question,>if your tables have dozens of columns that aren'tabout the relevant>then we don't need to hear about them, just tell ushelp. Just a few>columns and their datatypes.
>
>Providing some sample data for us to work with will alsospam trap so I>rows for each table - no need to use attachments.
>
>Bob Barrows
>
>--
>Microsoft MVP - ASP/ASP.NET
>Please reply to the newsgroup. This email account is mythen remove the>don't check it very often. If you must reply off-line,>"NO SPAM"
>
>
>.
>DebbieD Guest
-
Bob Barrows #5
Re: Data Grid or Data Matrix...
DebbieD wrote:
Yes, it's easy in Access, but not so easy in SQL Server. Have you done a> Hi Bob,
>
> I did exactly what I need in Access but it won't work in
> my Active Server Page because my back end is SQL. How
> can I translate this into a SQL query? Thanks!
>
> Hello,
>
> I've created this crosstab query in Access and works
> great but my back end is SQL2000. How can this be
> rewritten to pull from a SQL2000 database in an ASP?
> Thank you very much in advance.
>
> TRANSFORM Sum(qyMatrixTest.numitems) AS SumOfnumitems
> SELECT qyMatrixTest.cname
> FROM qyMatrixTest
> WHERE (((qyMatrixTest.ocustomerid)=271))
> GROUP BY qyMatrixTest.cname, qyMatrixTest.ocustomerid
> PIVOT qyMatrixTest.orderid;
>
>
Google search for crosstab and T-SQL? If so, you will find a lot of
solutions.
[url]http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=T%2DSQL+crosstab[/url]
The easiest solution may be to use an Access database with your SQL tables
linked in to run this Transform query. However, it may not perform very well
so YMMV.
If your budget can afford it, there's a tool called RAC
([url]http://www.rac4sql.com/[/url]) that makes crosstabs in SQL Server easy.
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest



Reply With Quote

