SunQuest
 
           Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 25th, 2003, 01:09 AM
suzy suzy is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Malaysia
Posts: 4 suzy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Total Sales

Hi all

I have three tables in an Access Database. They are,
Item Table
ItemID, Description, Price, Type

Inventory
InventoryID, ItemID, AcquiredDate, OnHand

Sales
SaleID, InventoryID, Date, QntySold

How do I find the total sale amount of all the items in a given date?

Its for an ASP page.

Heres my SQL so far

The SearchText is where the required date goes from ASP text box.

SQL = "SELECT Sale.Date, Sale.QntySold*Item.Price AS TotalSales
FROM Item, Inventory, Sales
WHERE ((Sale.InventoryID = Inventory.InventoryID) AND
(Inventory.ItemID = Item.ItemID)) AND
((Sale.Date) = '%"SearchText"%');"

But its not working. Can someone tell me what is wrong??

Thanks

Reply With Quote
  #2  
Old January 30th, 2003, 06:25 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
because you're trying to match the date, substitute the %s for # signs

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Total Sales


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not 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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway