Hey guys I have two tables, tblJobs and tblCustomers.
The tblJobs looks like this
JobID->Primary
CustomerID->Foriegn
UserID->Foriegn
RONumber
EstimateAmount
DateAdded
etc...
The tblCustomers looks like this
CustomerID->Primary
CustomerName
Street
City
DateAdded
etc...
Now, what I am trying to do is have a list of jobs that are selected between tow dates and the list should display
RONumber, CustomerName, EstimateAmount, JobID
My problem is getting the Customer Name. I have the CustomerID in the Jobs table, but I cant figure out how to get the CustomerName from the Customer table as a result in the query.
I tried doing something like this
$sql="SELECT * FROM tblCustomers AS a, tblJobs AS b WHERE UserID='$userID' AND b.DateAdded >= '$low' AND b.DateAdded <= '$high' AND a.CustomerID = b.CustomerID";
But that doesn't work right (returns no rows when it should). Also I am worried about the DateAdded fields messing with eachother and skewing the results.
Any Help is much appreciated! 🙂