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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql problem

Status
Not open for further replies.

fredericvandenplas

Programmer
Mar 31, 2006
4
BE
Hello there.
I have a form with 5 yes/no dropdown fields.
I want to display col1 (yes/no in dutch)
or col2(yes/no in french) col3(yes/no in english)
my main table has as fields Airco, hydraulics etc...
The yes_no has to come from a table as depending on the language choosen i gets col1,col2 or col3

When i run this sql
SELECT `Hydraulics`,`Airco`
FROM ((`main` INNER JOIN yes_no AS yes_no1 ON main.Hydraulics = yes_no1.idnumber) INNER JOIN yes_no AS yes_no2 ON main.Airco = yes_no2.idnumber)

I get hydraulics >> 1 (yes)
Airco >> 2 (no)
but not the content of the yes_no table.
It works in access where i tried it but not in Mysql
anny help would be very much appreciated
Frederic vandenplas Belgium

 
please do SHOW CREATE TABLE for each of your two tables

also, please show a couple of sample rows from each table

r937.com | rudy.ca
 
Well i managed it on my own ( only today i succeeded) with this sql.
I even had to add some more joins
thank you for the reply

SELECT main.Idnumber, `Referentie`,
`Omschrijving1`As Omschrijving, `Prijs`, `Pk`, `Type`, `Bouwjaar`, `Uren`, `Banden_voor`, `Banden_achter`,
ja_neen1.ja_neen1 As `Front_hef`,
ja_neen2.ja_neen1 As `Aftakas_vooraan`,
ja_neen3.ja_neen1 As `Airco`,
ja_neen1.ja_neen1 As `Luchtdruk`,
ja_neen1.ja_neen1 As `Nieuw`,
foto.Res2,
soort_machine.Soort_omschrijving1 AS Soort,
merk_machine.Merk As Merk,
prijs.Prijs1 As Prijs


FROM main

INNER JOIN ja_neen AS ja_neen1 ON ja_neen1.Idnumber=main.Front_hef
INNER JOIN ja_neen AS ja_neen2 ON ja_neen2.Idnumber=main.Aftakas_vooraan
INNER JOIN ja_neen AS ja_neen3 ON ja_neen3.Idnumber=main.Airco
INNER JOIN ja_neen AS ja_neen4 ON ja_neen4.Idnumber=main.Luchtdruk
INNER JOIN ja_neen AS ja_neen5 ON ja_neen5.Idnumber=main.Nieuw
INNER JOIN foto ON main.Idnumber=foto.Res1
INNER JOIN soort_machine ON main.Soort=soort_machine.Idnumber
INNER JOIN merk_machine ON main.Merk=merk_machine.Idnumber
INNER JOIN prijs ON main.Prijs=prijs.Idnumber
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top