Last post Jun 23, 2008 03:29 PM by Mikesdotnetting
Jun 22, 2008 10:10 PM|SofsIdsTuls|LINK
how do i join three tables in one form view?
i've tried joining two tables. this case MACHINE_WARRANTY & WARRANTY PERIOD table. Below is the query line in the datasource.
SELECT Machine_Warranty.Machine_Warranty_ID, Job_No, Cust_ID, Machine_SerialNo, Product_ID, Unit_Price, Payment_Type, date_format(Date_Installed,'%Y-%m-%d') as Date_Installed, Freebies, Remarks, Unit_Location, date_format(Date_Paid_MW,'%Y-%m-%d') as Date_Paid_MW,
Cheque_CC_No, date_format(Date_TrialStart,'%Y-%m-%d') as Date_TrialStart, Waterblock, Pressure_Regulator, Rental, Warranty_Start FROM
machine_warranty, warranty_period WHERE machine_warranty.machine_warranty_id= warranty_period.machine_warranty_id and Machine_SerialNo=?
Now, i want to include another table in this query line? is it possible and what are the other alternatives to join it together.
this case, i want to join two fields from JOB table.
Jun 23, 2008 01:46 AM|geosync|LINK
Yes, it is possible to join these two tables, and even a third...
I'm wondering if your syntax for table joins is correct: what database engine are you using? (Looks like maybe Access.)
Does this query work directly in the DB environment (i.e. Access)? Make it work there first, then you can track down why it isn't working in your FormView.
When you tried joining these tables, what happened? What error?
As far as alternatives go, I believe your best alternative is to make the query work. <grin>
Jun 23, 2008 04:32 AM|SofsIdsTuls|LINK
the thing is i do not know how to join three tables together and I'm enquiring about it. do you know?
the above query line works for two tables joined.
and i'm using EMS SQL Manager 2. and the query line is in the datasource.
Jun 23, 2008 12:26 PM|Mikesdotnetting|LINK
EMS SQL Manager 2
MySQL? Here's their docs on JOIN sysntax, which is the same for pretty much any database:
Jun 23, 2008 03:19 PM|geosync|LINK
EMS SQL Manager 2
Mike, I'm curious, how can you tell MySQL from this? EMS SQL Manager is available for various dbs; I have EMS SQL Manager for SQL Server.
Jun 23, 2008 03:29 PM|Mikesdotnetting|LINK
Mike, I'm curious, how can you tell MySQL from this?
I can't. I was just guessing/asking. The guess is based on my hunch that it is unlikely that someone who is learning how to do JOINS would go to the trouble of downloading an alternative to SSMS if they are using SQL Server (Express), or be using PostGreSQL.
And there are plenty of shared hosting packages that offer MySQL for nothing...
But of course, I could be wrong. It has been known [;)]