home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2735
Discussions: 188,384, Posts: 2,243,508, Members: 232,615
Old April 26th, 2003, 06:50 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Apr 2003
Posts: 27
Urgent Help Required!!!!!!!

i have this one query to do in database and i could not figure out how to do that, first of all the question is The databasemust have the ability of producing (on demand) reports on current sales figures, such reports shell provide valuable statistical information on the number of items sold for each product (up to a period of one year). that was the questions and i need to find out the sales figures and the tables i have are CUSTOMER, ORDER, EMPLOYEES, PRODUCTS, SUPPLIERS, there are the tables and what formula or methods do i need to use in query to get the sales figures

Cheers

I hope u all will try ur best to solve this matter

Makavali is offline   Reply With Quote
Old April 27th, 2003, 06:27 PM     #2 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,019
[quote]what formula or methods do i need to use in query to get the sales figures

Possibly...

SUM
COUNT
GROUP BY (required by SUM and COUNT)

Although its sounding like homework, so can't give it all away

vass0922 is offline   Reply With Quote
Old April 27th, 2003, 09:20 PM     #3 (permalink)
Junior Member
 
Join Date: Apr 2003
Posts: 27
vass thanks very much for replying but i dont understand what u have described here, and its not a homework, i have created a database for my uncle's work and he asked to produce a sales figure report, please could u explain me again
__________________
WestSide, BadBoy Killer

Makavali is offline   Reply With Quote
Old April 27th, 2003, 10:12 PM     #4 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,019
You're not really giving us any information to work with. We don't have the table structure to give you the data you require...

You're giving us a 4 tires, and telling us to build a car

What are the columns in the tables? What are the relationships?

SUM, COUNT, GROUP BY are SQL functions that are great for reports but we have no information to build a real query.
vass0922 is offline   Reply With Quote
Old April 27th, 2003, 10:24 PM     #5 (permalink)
Ultimate Member
 
crouse's Avatar
 
Join Date: Jun 2002
Location: Iowa
Posts: 2,879
Send a message via ICQ to crouse
I suspect this thread will be kept open, and the others closed, so I'll post here.

#1 what type of database are you using ?
__________________
USA Linux Users Group
OpenSUSE.us
crouse is offline   Reply With Quote
Old April 28th, 2003, 06:42 AM     #6 (permalink)
Junior Member
 
Join Date: Apr 2003
Posts: 27
First of all i am sorry for posting double threads, didnt know, anyway i dont why u guys keep saying its a home work, i am using Microsoft Access Database, and this time i will try my best to give you all the related information which i hope will help u guys to understand more about this problem. customer table is related to Order, Customer-1-m- Order( that means one to many), Order table is related to Product, Order-m-1-product, Order table is related to Employee table, Order-m-1-employee, product related to supplier, product-m-1-supplier, employee table related to department table, employee-m-1-department. now i will tell you the entitys of these tables.

Customer table

Custmer Id No (p Key)
Surname
forename
Date Of birth
Address
Telephone No
Cradit

Order Table

Order ID No (p key)
Customer Id Number
Product No
Quantity
Employee Id No
Date Of Order
Total Price

Product Table

Product Name
Product No (p Key)
Product Cost
Amount Purchased
Supplier Id Number
Date of Order

Employee Table

Employee ID No (p key)
Department Name
Name

Department Table

Department Name (p key)

Supplier Table

Supplier Id No (p key)
supplier Name
Address
Telephone No

that is my Access database structure. i hope u guys understand and i am sorry surreal for posting same threads to many times.
Makavali is offline   Reply With Quote
Old April 30th, 2003, 12:29 AM     #7 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,019
It looks like ORDER will be your primary table so you can start simple


SELECT *
FROM ORDER

Then you can add a join
Code:
SELECT *
FROM ORDER
  INNER JOIN PRODUCT
    ON PRODUCT.[PRODUCT NO] = ORDER.[PRODUCT NO]
WHERE DATEDIFF(year, 1, Now(), ORDER.[DATE OF ORDER]) < 1
Something like that should get ya started...


why is date of order in the product table
vass0922 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2896)
CPU wont boot (6)
3-days in and no threads about Gaza (160)
The United States Debt (20)
I think I just killed my computer w.. (24)
hp compaq nc6000 problems (139)
Upgrading RAM (5)
Folderchat Weekday thread (442)
Antec 300 bulk purchase? (11)
Recent Discussions
CPU wont boot (6)
GLaDOS is up. (3)
HP notebook reinstall Vista NO .. (5)
Building a gaming computer advi.. (4)
hp compaq nc6000 problems (139)
Folderchat Weekday thread (442)
Creative T-3000 Subwoofer (3)
ACPI controller halt on boot (2)
Worth the upgrade?? (15)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 10:22 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28