Seems like I saw this somewhere, but I've just spent an hour searching and can't find any clear answer...
I am writing a SELECT statement with a LEFT JOIN, and I want to JOIN on all fields which have the same field name in both tables. Naturally, I can specify each of the field names in the ON portion of the JOIN statement, but it seems to me there was a shortcut if the field names happened to be identical in both tables... am I nuts?
Here's an example of what I'm doing:
What I'm trying to accomplish is to detect when there has been a change in any field in tblSchedule since the last time the user looked at it, so there are about 18 fields that are common to both tables. Is it possible without "ON (s.field1 = t.field1) AND (s.field2 = t.field2) AND .... over and over?
I am writing a SELECT statement with a LEFT JOIN, and I want to JOIN on all fields which have the same field name in both tables. Naturally, I can specify each of the field names in the ON portion of the JOIN statement, but it seems to me there was a shortcut if the field names happened to be identical in both tables... am I nuts?
Here's an example of what I'm doing:
Code:
strSQL = "Select * FROM tblSchedule " & _
strSQL = strSQL & "LEFT JOIN tblTimeStamp " & _
strSQL = strSQL & "ON ([COLOR=red]here's where I'm stuck[/color]);"
What I'm trying to accomplish is to detect when there has been a change in any field in tblSchedule since the last time the user looked at it, so there are about 18 fields that are common to both tables. Is it possible without "ON (s.field1 = t.field1) AND (s.field2 = t.field2) AND .... over and over?