Please help with select statement!

Results 1 to 2 of 2

Thread: Please help with select statement!

  1. #1
    Join Date
    Dec 1969

    Default Please help with select statement!

    I&#039;m doing a query displaying the descriptions of an item including its image based on the user input field "item". My select statement works fine however, the page displays only when there&#039;s an image. This is a problem b/c we don&#039;t have images for every item.. I know we can put a left outer join to include all the images if the imagepath is null but I really have to clue on how to insert it in this complex select statement with all these conditions!! Can someone please help me on this?? Your help is greatly appreciated!<BR>There are 4 tables: spechist, iattr, aid, and image.<BR>The image table consists of: item and imagepath <BR>&#039;my select statement<BR>str="SELECT DISTINCT spechist.description, iattr.color, aid.item, aid.order, aid.process, iattr.order, iattr.process, image.imagepath FROM aid, iattr, spechist, image WHERE (aid.item=&#039;" & ItemNumber & "&#039;) AND (aid.order=iattr.order) AND (aid.process=iattr.process) and (spechist.item=aid.item) and (spechist.display=yes) AND (type=&#039;I&#039;) and (image.item=aid.item) "<BR>...<BR>...<BR><BR>&#060;img src="&#060;%=imagepath%&#062;"&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Please help with select statement!

    Hi,<BR><BR>in ure where statement ure using ANDs which means all the conditions must be true in order to pop the recset... what ure asking for is the imagename as well as a condition.. i take it ure image table uses the same ID and if there is not an image name the ID is not in that table...<BR><BR>another thing u mite want to try is JOINS in ure select statement to link table IDs<BR><BR>l8z

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts