Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
hallyvaux
Starting Member
12 Posts |
Posted - 2011-05-02 : 17:18:51
|
| I created a view from my last report and I need to use the alias names for various reports and I cannot for the life of me remember how to do this. For instance, I created a view based on this report SELECT NAME "Proudct Name", SUM(ORDERQTY)"Qty Ordered" ,SUM(SELLPRICE) "Price Sold" ,SUM(SELLPRICE) * SUM(ORDERQTY) "Total Sale"FROM GS_SALES,GS_PRODUCTSWHERE GS_SALES.PRODID = GS_PRODUCTS.PRODIDGROUP BY SELLPRICE, NAMEORDER BY SELLPRICE DESC;The view I created is Create view problem7View ASSELECT NAME "Proudct Name", SUM(ORDERQTY)"Qty Ordered" ,SUM(SELLPRICE) "Price Sold" ,SUM(SELLPRICE) * SUM(ORDERQTY) "Total Sale"FROM GS_SALES,GS_PRODUCTSWHERE GS_SALES.PRODID = GS_PRODUCTS.PRODIDGROUP BY SELLPRICE, NAMEORDER BY SELLPRICE DESC;Now when I go to select column names to use them (Select "Qty Ordered" From problem7View), it says that it doesn't exist. I'm sorry that this is super basic but I'm very new to this.Thank you. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
hallyvaux
Starting Member
12 Posts |
Posted - 2011-05-02 : 17:39:29
|
| Ok. That makes sense. I was just creating the view off of the report where I wanted the spaces but to create the view I went back and changed to names like qty_ordered. Ty. :) |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|
|