Two Primary fields????????????

K

Kentucky5

UPDATE Final INNER JOIN From ON [Final].[ID] = [From].[ID]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


This query works when dealing with one primary field but
in this case I need to compare the ID and the VIN and make
sure that neither is a duplicate. If they do then I would
want certain data to be updated into the final table.

I hope this is clear.
 
K

Ken Snell

Sounds as if you need two joining fields:

UPDATE Final INNER JOIN From ON [Final].[ID] = [From].[ID]
AND [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From].[Comments]
WHERE (((From.Comments) Is Not Null));
 
T

Tom Ellison

Dear Kentucky:

You can, and may occasionall need, more than one unique constraing on
a table. A primary key is just a special case of a unique index, of
which you can have several.

Or, if the VIN is unique, you could use that INSTEAD of the ID and
improve performance by not having an additional column and an
additional index.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
T

Tom Ellison

Or, you could spell that c-o-n-s-t-r-a-i-n-t. That is you could,
apparently I cannot.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


Dear Kentucky:

You can, and may occasionall need, more than one unique constraing on
a table. A primary key is just a special case of a unique index, of
which you can have several.

Or, if the VIN is unique, you could use that INSTEAD of the ID and
improve performance by not having an additional column and an
additional index.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


UPDATE Final INNER JOIN From ON [Final].[ID] = [From].[ID]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


This query works when dealing with one primary field but
in this case I need to compare the ID and the VIN and make
sure that neither is a duplicate. If they do then I would
want certain data to be updated into the final table.

I hope this is clear.
 
K

Kentucky5

Now will this do one or the other or only if both match?

-----Original Message-----
Sounds as if you need two joining fields:

UPDATE Final INNER JOIN From ON [Final].[ID] = [From].[ID]
AND [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From]. [Comments]
WHERE (((From.Comments) Is Not Null));


--
Ken Snell
<MS ACCESS MVP>


UPDATE Final INNER JOIN From ON [Final].[ID] = [From]. [ID]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


This query works when dealing with one primary field but
in this case I need to compare the ID and the VIN and make
sure that neither is a duplicate. If they do then I would
want certain data to be updated into the final table.

I hope this is clear.


.
 
K

Ken Snell

This will require both to match.

--
Ken Snell
<MS ACCESS MVP>

Kentucky5 said:
Now will this do one or the other or only if both match?

-----Original Message-----
Sounds as if you need two joining fields:

UPDATE Final INNER JOIN From ON [Final].[ID] = [From].[ID]
AND [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From]. [Comments]
WHERE (((From.Comments) Is Not Null));


--
Ken Snell
<MS ACCESS MVP>


UPDATE Final INNER JOIN From ON [Final].[ID] = [From]. [ID]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


This query works when dealing with one primary field but
in this case I need to compare the ID and the VIN and make
sure that neither is a duplicate. If they do then I would
want certain data to be updated into the final table.

I hope this is clear.


.
 
K

Kentucky5

I want it to be either or, how would I do that?
-----Original Message-----
This will require both to match.

--
Ken Snell
<MS ACCESS MVP>

Now will this do one or the other or only if both match?

-----Original Message-----
Sounds as if you need two joining fields:

UPDATE Final INNER JOIN From ON [Final].[ID] = [From]. [ID]
AND [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From]. [Comments]
WHERE (((From.Comments) Is Not Null));


--
Ken Snell
<MS ACCESS MVP>


"Kentucky5" <[email protected]>
wrote
in message
UPDATE Final INNER JOIN From ON [Final].[ID] =
[From].
[ID]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


This query works when dealing with one primary field but
in this case I need to compare the ID and the VIN
and
make
sure that neither is a duplicate. If they do then I would
want certain data to be updated into the final table.

I hope this is clear.


.


.
 
K

Ken Snell

Not sure if this will do what you want, but it will return records if either
of the linking fields match:

UPDATE Final INNER JOIN From ON [Final].[ID] = [From].[ID]
OR [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From].[Comments]
WHERE (((From.Comments) Is Not Null));


--
Ken Snell
<MS ACCESS MVP>

Kentucky5 said:
I want it to be either or, how would I do that?
-----Original Message-----
This will require both to match.

--
Ken Snell
<MS ACCESS MVP>

Now will this do one or the other or only if both match?


-----Original Message-----
Sounds as if you need two joining fields:

UPDATE Final INNER JOIN From ON [Final].[ID] = [From]. [ID]
AND [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


--
Ken Snell
<MS ACCESS MVP>


in message
UPDATE Final INNER JOIN From ON [Final].[ID] = [From].
[ID]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


This query works when dealing with one primary field but
in this case I need to compare the ID and the VIN and
make
sure that neither is a duplicate. If they do then I
would
want certain data to be updated into the final table.

I hope this is clear.


.


.
 
K

Kentucky5

I will try that and let you know if it works
Thanks
-----Original Message-----
Not sure if this will do what you want, but it will return records if either
of the linking fields match:

UPDATE Final INNER JOIN From ON [Final].[ID] = [From].[ID]
OR [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From]. [Comments]
WHERE (((From.Comments) Is Not Null));


--
Ken Snell
<MS ACCESS MVP>

I want it to be either or, how would I do that?
-----Original Message-----
This will require both to match.

--
Ken Snell
<MS ACCESS MVP>

Now will this do one or the other or only if both match?


-----Original Message-----
Sounds as if you need two joining fields:

UPDATE Final INNER JOIN From ON [Final].[ID] =
[From].
[ID]
AND [Final].[VIN] = [From].[VIN]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


--
Ken Snell
<MS ACCESS MVP>


in message
UPDATE Final INNER JOIN From ON [Final].[ID] = [From].
[ID]
SET Final.Journals = [Final].[Comments]+": " & [From].
[Comments]
WHERE (((From.Comments) Is Not Null));


This query works when dealing with one primary field but
in this case I need to compare the ID and the VIN and
make
sure that neither is a duplicate. If they do then I
would
want certain data to be updated into the final table.

I hope this is clear.


.



.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top