Jump to content
Server Maintenance This Week. ×

Very simple JOIN


This topic is 3178 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi all

I'm pulling my hair out with this one, I've tried everything but to no avail, very frustrating as I know it's a simple one.

I just want to list the postcode fields from the addresses table, where the log_idf of the mileages table is equal to the current record of the Log_Log table. See pic for the relationship I'm trying to recreate.

This is what  I have so far:

ExecuteSQL ( "
SELECT S.Postcode 
FROM Addresses S
JOIN Mileages T
ON T.Address_IDF_From = S.Address_ID
WHERE T.Log_IDF = ?
"; ""; ""; Log_Log::Log_ID)

 

TIA

sql.png

Ah sorted now. The field types in the JOIN were not of the same type.

BTW, should ID's be set as numbers always? I've always done them as text.

Edited by sal88
Link to comment
Share on other sites

This topic is 3178 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.