473,396 Members | 1,797 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.

Help on Sql in Access and ASP

145 100+
im have tables in access,Customer,Products and Order Table...

Customer Table:
Expand|Select|Wrap|Line Numbers
  1. Cust_ICNumber (PK) 
  2. Cust_Name 
  3. Cust_Address 
  4. Cust_PrimaryNumber 
  5. Cust_SecondaryNumber 
  6. Cust_Company 
  7. Cust_CompanyType 
  8.  
Products Table
Expand|Select|Wrap|Line Numbers
  1. Product_ID (PK) 
  2. Product_Name 
  3. Product_Price 
  4. Product_Picture 
  5.  
Order Table
Expand|Select|Wrap|Line Numbers
  1. Order_ID(PK) 
  2. Product_ID(FK) 
  3. Order_Quantity 
  4. Order_Date 
  5. Customer_ICNumber (FK) 
  6. Total_Price 
  7.  
I intend to output bill (a classic asp file) from order table which will display Order ID,Product Name,Product Price, Customer Name,Customer Address,Order Date.
I wondering if this sql is correct and can be used in classic ASP
Expand|Select|Wrap|Line Numbers
  1. SELECT tCustomer.Cust_Name,
  2.        tCustomer.Cust_Address,
  3.        tProducts.Product_Name,
  4.        tOrder.Order_Quantity,
  5.        tOrder.Order_Date,
  6.        tOrder.Order_ID,
  7.        tOrder_Total_Price
  8.  
  9. FROM   (((Order AS tOrder LEFT JOIN
  10.        Customer AS tCustomer
  11.   ON   tOrder.Customer_ICNumber=tCustomer.Cust_ICNumber) LEFT JOIN
  12.        Products AS tProducts
  13.   ON   tOrder.Product_ID=tProducts.Product_ID);
because I have been trying to use this code but i keep getting error on this at the FROM clause.
Oct 8 '09 #1

✓ answered by MikeTheBike

@puT3
Hi
I am not too sure about classic ASP, I have not used it at all (in anger) but have two comments on you query

1. Your have, too many opening brackets in the FROM clause (hence the error?)

2. I not sure why you have used alias named for each tables (perhaps this is for ASP!)?

Does that help?


MTB

5 1424
MikeTheBike
639 Expert 512MB
@puT3
Hi
I am not too sure about classic ASP, I have not used it at all (in anger) but have two comments on you query

1. Your have, too many opening brackets in the FROM clause (hence the error?)

2. I not sure why you have used alias named for each tables (perhaps this is for ASP!)?

Does that help?


MTB
Oct 8 '09 #2
NeoPa
32,556 Expert Mod 16PB
PuT3, you've clearly gone to some trouble laying the tables out, which is appreciated. I expect if you'd done the same with the SQL you would have seen the problem yourself very easily (No criticism - just irony - you did a good job overall).

MTB hit the nail on the head (and he even managed it before the reformat - Kudos).

PS. @MTB - Using Aliases is not too unusual. Sometimes simply to see them displayed in a standard format. I use them myself sometimes to shorten the names so making qualifying field references easier.
Oct 8 '09 #3
puT3
145 100+
oo..That's mean i should delete the brackets ok...i will try it...thanks...
Oct 9 '09 #4
MikeTheBike
639 Expert 512MB
@NeoPa
Point taken, even done the latter myself, but in this case, just seemed no make it more complicated (was just a comment) !!

Cheers


MTB
Oct 9 '09 #5
NeoPa
32,556 Expert Mod 16PB
@puT3
Not exactly. I assume you're referring to the parentheses when you say brackets. What you need is to ensure they're balanced (opens all have matching closes) rather than to remove them completely.

PS. @MTB - I wasn't trying to criticise - just commenting from one expert to another. Sorry if it came across wrongly.
Oct 9 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tom marsh | last post by:
I'm finishing an application and want to supply help files. However MS Access's help files, ironically don't contain much help on HELP. What is the best approach? I could easily just provide...
2
by: Douglas | last post by:
I was trying to look up Access Help for the GetSetting, SaveSetting commands to implement in my DB code when i press F1, up pops the Microsoft Access Help, if i click Index and type in Get, all...
2
by: BT Openworld | last post by:
I have just had to upgrade to Access 2003 as Access 97 EMail (SendObject) doesn't work when loaded on Windows XP. I'm finding my way around Access 2003 but my biggest problem is getting...
3
by: Mitchell Thomas | last post by:
I hope someone out there can solve my mysterious problem. I have tried everything imaginable, even paid $35 to Microsoft to help me, but they were not able to figure out this problem: Here is the...
2
by: Vladislav Moltchanov | last post by:
Recently I have changed from Acc97 to Acc2000 (I had to supply some data entry tools for field data collection for users still using Acc97). Among lot of other complications coming with Acc2000...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
27
by: Bruce Dodds | last post by:
I recently started using Access 2003 for the first time. I wanted to pass on some comments about the Help system to Access MVPs who frequent this board. I'm doing this in the hope that some of...
2
by: J | last post by:
I use Access 97 and Windows XP (Sp2 if that matters) I mostly program for myself, but am now writing an application for my wife's club and need to include a help file with the database I am...
2
by: Joe Rigley | last post by:
Help Please! I've been tasked with converting a portion of the corporate web site that currently utilizes local user accounts and NTFS via Basic Authentication to access certain files on the...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.