SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 7th, 2005, 06:38 AM
intrigue's Avatar
intrigue intrigue is offline
www.diebythesword.net
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Leicester, UK
Posts: 202 intrigue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 49 m 53 sec
Reputation Power: 6
Send a message via ICQ to intrigue Send a message via MSN to intrigue Send a message via Yahoo to intrigue
SQL Query problem

Code:
"SELECT DISTINCT tblstock.name AS consumable_Name, Count(tblstock.name) AS Total, Max(tblconsumables.required) AS Required  FROM tblconsumables INNER JOIN tblstock ON tblconsumables.id = tblstock.id2 WHERE (tblstock.available)='Yes' GROUP BY tblstock.name"

Ok i have the above code but the problem is it will only show me the consumables that have at least 1 item in stock so if theres none it doesnt say i need to order anymore it just doesnt show it.

My tables are as follows

ConsumableTypes
id
name
required

ConsumableStock
id
name
price
id2 (corrosponds to id of ConsumableTypes)
available

Id like the query to count check the amount of each of the consumableTypes and check it against how many is required and display the results.

Any ideas on a query to do this. I will have a go and see what i can come up with too
TIA
.matt
__________________
Has this been of help? If so click me scales icon at the top right of this post you know you want to.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > SQL Query problem


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT