Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42486

Please Help with this query

$
0
0
I as using MySql and need to query using a join on these two tables
to provide both town names i.e. From Town and To town
I am able to get the one or the other but not both.
The two tables are joined by TOWN_ID

Table #1

TOWN_ID
TownName

Table #2

ORDER_ID
OrderNumber
Date
FromTown_ID
ToTown_ID

Here is what i Have that returns either one or the other

The query i have is as follows:

select orders.OrderNumber,Orders.Date,Towns.TownName
From (Orders Join towns on((orders.FromTown_ID=town.Town_ID)))

You can obviously substitute 'FromTown_ID' to 'ToTown_ID' to get the other town
but how do i get the query to return both towns in the same query?

Viewing all articles
Browse latest Browse all 42486

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>