ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion 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:
  #1  
Old May 25th, 2005, 01:18 AM
dunskii dunskii is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 45 dunskii User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 21 m 14 sec
Reputation Power: 4
two and three selects related problems

Hello all,

I am in the process of using a couple of custom tags cf_twoselectsrelated and cf_threeselectsrelated i found at mm exchange. Which basically allow you to dynamically relate 2 or 3 selects. And as I'm having the same prob with both i thought i'd put them together.

Basically the problem is that when a value is chosen from the first select box the second select displays all values related to all values in the first select, instead of just displaying the values related to the one chosen in the first select. (hope that makes sense).

I thought that this could be due to the query. So I added a INNER JOIN, then and OUTER JOIN just to be sure and i get this error for both: Cannot join on Memo, OLE, or Hyperlink Object ([sc].[category_id]=[c].[category_id]), i dont have any Memo, OLE, or Hyperlink Object in the tables.

While i'm here i'd better check the the way to join 3 tables is:
select * from table1 t1 inner join table2 t2 on t1.id = t2.id inner join table3 t3 on t2.id2 = t3.id2, as i get a syntax error with this one.

any help on this would be appreciated or if you know a better way to relate multiple select please let me know as my hair is starting to fall out on this one.

before i forget i'm using an access db, though am about to migrate to mysql

cheers,

ad

Reply With Quote
  #2  
Old May 25th, 2005, 08:17 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,648 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 12 h 8 m 8 sec
Reputation Power: 53
Does the tag come with some sort of example of documentation?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old May 25th, 2005, 08:24 AM
dunskii dunskii is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 45 dunskii User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 21 m 14 sec
Reputation Power: 4
yes, but when i tried it i kept getting errors.

the example was

select * from table t1, table2 t2 where t1.id = t2.id

when i tried that way i kept getting syntax errors so i thought an inner join would work but got a different error... i'm starting to think i have a probelm with my db

Reply With Quote
  #4  
Old May 25th, 2005, 09:32 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,648 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 12 h 8 m 8 sec
Reputation Power: 53
Yes, I'd get the example working as they presented it before I did anything further.

Reply With Quote
  #5  
Old May 25th, 2005, 12:07 PM
dunskii dunskii is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 45 dunskii User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 21 m 14 sec
Reputation Power: 4
well i got the two select working, now with the threeselectrelated ... my second of three select is only showing one record and my third is showing the records for all available in the second... i have come to the conclusion that it is my query .. though dont know where to start...

this the example they gave me ...
SELECT Customers.CustomerID, Customers.Company, Category.ID, Category.Category, Inventory.BookID, Inventory.Title FROM Category, Customers, Inventory, OrderItems, Orders WHERE Category.ID = Inventory.CategoryID AND OrderItems.BookID = Inventory.BookID AND Orders.OrderID = OrderItems.OrderID AND Customers.CustomerID = Orders.CustomerID ORDER BY Customers.CustomerID, Category.ID

this is what i'm doing though i'm using joins, i tried their way and get the same result

SELECT Distinct
m.Market_ID,
m.Market_Name,
z.Zone_ID,
z.Zone_Name,
a.Area_ID,
a.Area_Name
FROM
(
Market m INNER JOIN Zone z ON [m].[market_id] = [z].[market_id]
)
INNER JOIN Area a ON [a].[zone_id] = [z].[zone_id]


cheers

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > two and three selects related problems


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