MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL 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 Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 15th, 2004, 11:00 AM
infael infael is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 infael User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SELECT DISTINCTROW not working

I'm working on a phone inventory database where someone who gets a phone will input their names and phone type (ie Treo 300, treo 600, etc).

I've been working on a report to select a certain phone type but keep getting all the phones instead of just the phone type I selected. For example, if I select treo300 from the drop down box, the report returns everything in the database instead of just the treo300.

The latest code I've tried is

SELECT DISTINCTROW [phones].[PhoneType]
FROM phones;

I've also tried DISTINCT and that didn't work either. I'm thinking the problem must be elsewhere but have not been able to figure out where the problem could be.


TIA
infael

Reply With Quote
  #2  
Old June 15th, 2004, 03:18 PM
qqhq qqhq is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 8 qqhq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Your query doesn't have a condition.

Reply With Quote
  #3  
Old June 15th, 2004, 05:14 PM
infael infael is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 infael User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I should not need a condition as I'm selecting the phone type from a drop down box. After click, the SQL query is executed. Right?

Thanks!
infael

Reply With Quote
  #4  
Old June 16th, 2004, 08:12 AM
qqhq qqhq is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 8 qqhq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You selected criteria from drop down, but it didn't pass to the query. You should pass your selected one to the query as the condition.

Reply With Quote
  #5  
Old June 16th, 2004, 09:52 AM
infael infael is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 infael User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
THANKS qhhq!!!!!!! I finally got the query working. However, when I click on the drop down box, I get a messagebox asking for a parameter and the report still returns everything in the database. The dropdown box is empty now as well.

SELECT DISTINCTROW phones.PhoneType
FROM phones
WHERE (((phones.PhoneType)=[phonesearch].[phonetype]));

Can you pelease help me out a little more?

TIA
infael

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > SELECT DISTINCTROW not working


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 3 hosted by Hostway