|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Your query doesn't have a condition.
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SELECT DISTINCTROW not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|