線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1142
推到 Plurk!
推到 Facebook!

Problem with SQL String

尚未結案
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-08 23:28:41 IP:217.34.xxx.xxx 未訂閱
The following is exact what I applied in the my ADOQuery: select OrderNumber, OrderTime, DishID, DishName, Description, Price, Quantity, (Price * Quantity) as SubTotal from DetailTable D, OrderHistory O, Menu M where D.OrderNumber = O.OrderNumber and D.DishID = M.ID and OrderNumber = OrderNumber When I try to active the query in object inspector. it pops up a error message: The specified field 'OrderNumber' could refer to more than one table listed in the FROM clause of your SQL statement Any Clue what's happening? 發表人 - vashee 於 2003/04/08 23:35:50
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-09 00:07:41 IP:218.16.xxx.xxx 未訂閱
select O.OrderNumber, OrderTime, DishID, DishName, Description, Price, Quantity, (Price * Quantity) as SubTotal from DetailTable D, OrderHistory O, Menu M where D.OrderNumber = O.OrderNumber and D.DishID = M.ID and OrderNumber = OrderNumber The first O.OrderNumber is not neccessary but more clear I dont know what you are doing with the last line.
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-09 00:15:04 IP:217.34.xxx.xxx 未訂閱
hey yeah!!.. i finally can active this query .. sniff. sniff...    i know I will be asking a very very stupid (please don't shout at me)
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-09 00:27:47 IP:217.34.xxx.xxx 未訂閱
qOrder.Parameters[0].Value := tHist.FieldByName('OrderNumber').Value; Justmade. Can u explain what this statement means as well? My knowledge of basic programming is really empty. I am sorry asking stupid question frequently Thanx again justmade I have made learning from u alot
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-04-09 00:39:03 IP:218.16.xxx.xxx 未訂閱
printing , displaying order detail or so if you need to select only a specific order number such as 13 you need to add this line at the end of the SQL and O.OrderNumber = :OrderNumber BEFORE seting the ADOQuery.Active := true add : ADOQuery.Parameters.ParamValues['OrderNumber'] := 13;
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-04-09 01:03:49 IP:217.34.xxx.xxx 未訂閱
so this Query have nothing to do saving any information in the table. what it does is gathering information from tables but where are these information going to? a template? so this query is just made for printing the invoice?
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-04-09 10:14:45 IP:218.16.xxx.xxx 未訂閱
What are you studying ? Analyst Programmer who work on his own project and only ask for help when really need ? Or "Project Co-ordinator" who co-ordinate OTHER's works together ? I am really amazed that after a week, you still have NO knowledge on SQL. It seems to me that you have do very very very few, if not none, reading on SQL and you are just trying to grab info and works here and there to compose your project. If you have spend a few hours reading basic SQL material, you wont be asking such questions. Frankly, I am not too resisted to help those students who only work when deadline are near. However, the bottom line is at least they work hard to finsih the project themselves and only ask for help when necessary. You appeared to have been done some foundation planing in the begining and that's why I tried to help. However, from time to time, you show your ignorent in nearly all aspect and it become clear the initial planing is just grabbed from other places. I know you wont appeciate such commend so I will stop here and so do my further help.
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#8 引用回覆 回覆 發表時間:2003-04-09 19:48:10 IP:195.195.xxx.xxx 未訂閱
u are right, I shouldn't be asking so many basic of basic question, but my situation leave me no choice. I am a college studen doing computing, and because of some circumstance I have left my computing project really late to do. Before I come in this forum, I have brought a Mastering Delphi 7 book, but I just don't have the time to digest it and what it is covering need time and thinking, but my situation doesn't allow that. That's why I have to come in there asking immediate solution. As I stated before I will be sounding like asking people to design the program for me. Also, i got a few coursework line up for other subject. I am undering varies of pressure. Justmade, I just got until tomorrow to finish everything, so I guess I won't be asking anymore after that. But I still go a few problem to solve, so please guide me through and I will be greatful. Thanx
系統時間:2024-07-01 18:33:57
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!