Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL problems?? Please Help!!!

Status
Not open for further replies.

BigFizil

MIS
Mar 9, 2003
23
US
I have a form that through VB code loads information from 2 tables in a WEB or Paging style format..


Basically one table is nothing but pictures with basic information and there are various pictures for each "ID" number because of revisions to te product design.

the other table is a list of information about each "ID" product w/ ID being my FK and no duplicates of this....

My current SQL is omitting information.....?

"select * FROM Development, developmentpictures WHERE Development.[KinderNumber] = developmentpictures.[KinderNum]"

What I want with my form is to return everypicture and next to the picture I want the information from the information table to populate about that ID that pertains to that picture........


hopefully this makes sense and Please help!!!!

 
Hi,
I would first remove the * wildcard and use field names.
Something like this:

SELECT a.picture_name ,b.picture_desc
FROM Development a, developmentpictures b
WHERE a.[KinderNumber] = b.[KinderNum]

See if this gets you closer.
John


*********************
John Nyhart
*********************
 
It's not about how you're grabbing the fields, it's about the join you're using. You're using an orthagonal join with a requirement that two of the fields match. It's a fine thing to do, but it will only return records where those fields match.

You want to use an outer join to get all of the records from one table and whatever records from the other table match.

Try this:
"select * FROM Development RIGHT JOIN developmentpictures ON Development.[KinderNumber] = developmentpictures.[KinderNum]"


After all that, I will say that Access is not a great engine for pictures. But if it works for ya, more power.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Yes....I am using a right join Now the reason I was omiting fields because I had the # set to 8 per page but only have 5 boxes to display pics. so each page was omitting 3 records......3 * 60 pages is alot of missed errors....I am using DB pix as my picture manipulater for Access but I will soon be rolling up to SQL box and creating JSP pages to access the data....so my road is getting bumpier....so I ask of you my fellow DB gurus please do wish me luck!!!

thanks for the replies


John
JDFOUSE02@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top