SET Function in SQL Query?

K

Kentucky5

I am trying to use the SET function in my query, How do
you use that if you have multiple fields that need to be
set?

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


Above is the code

So say I have 20 more fields that need to be set I was
trying

UPDATE Final INNER JOIN [From] ON [Final].[CaseID] =
[From].[CaseID] SET Final.Journals = [Final].[Journals]
+": " &"- "& [From].[Journals] & Final.EntryDate = [From].
[EntryDate] & Final.Region = [From].[Region]
WHERE (((From.Journals) Is Not Null));

I have more than this but when I run this it says it is
updating the table but doesn't, and I don't get any error
messages
 
G

Gary Walter

It looks like you just need to
replace ampersands with
comma and space.

SET somefield=something, anotherfield=something, etc

Did you try this?

UPDATE Final INNER JOIN [From] ON [Final].[CaseID] =
[From].[CaseID] SET Final.Journals = [Final].[Journals]
+": " &"- "& [From].[Journals], Final.EntryDate = [From].
[EntryDate] , Final.Region = [From].[Region]
WHERE (((From.Journals) Is Not Null));
 
K

Kentucky5

YES, thank you that seems to work. Now it seems like it
is truncating some of the text in my journals field and
not bringing it all over?????

-----Original Message-----
It looks like you just need to
replace ampersands with
comma and space.

SET somefield=something, anotherfield=something, etc

Did you try this?

UPDATE Final INNER JOIN [From] ON [Final].[CaseID] =
[From].[CaseID] SET Final.Journals = [Final].[Journals]
+": " &"- "& [From].[Journals], Final.EntryDate = [From].
[EntryDate] , Final.Region = [From].[Region]
WHERE (((From.Journals) Is Not Null));

I am trying to use the SET function in my query, How do
you use that if you have multiple fields that need to be
set?

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


Above is the code

So say I have 20 more fields that need to be set I was
trying

UPDATE Final INNER JOIN [From] ON [Final].[CaseID] =
[From].[CaseID] SET Final.Journals = [Final].[Journals]
+": " &"- "& [From].[Journals] & Final.EntryDate = [From].
[EntryDate] & Final.Region = [From].[Region]
WHERE (((From.Journals) Is Not Null));

I have more than this but when I run this it says it is
updating the table but doesn't, and I don't get any error
messages


.
 
K

Kentucky5

Never mind, I figured out that the field was set to text
255 instead of memo field, that fixed that problem. Now I
just have to figure out how when I do the make table it
makes the fields the format that I want. I know I have
set the fields in the query that way but it still does not
put it in the proper format. I really have this issue
with the date field, because it pulls over the time as
well.

-----Original Message-----
YES, thank you that seems to work. Now it seems like it
is truncating some of the text in my journals field and
not bringing it all over?????

-----Original Message-----
It looks like you just need to
replace ampersands with
comma and space.

SET somefield=something, anotherfield=something, etc

Did you try this?

UPDATE Final INNER JOIN [From] ON [Final].[CaseID] =
[From].[CaseID] SET Final.Journals = [Final].[Journals]
+": " &"- "& [From].[Journals], Final.EntryDate = [From].
[EntryDate] , Final.Region = [From].[Region]
WHERE (((From.Journals) Is Not Null));

I am trying to use the SET function in my query, How do
you use that if you have multiple fields that need to be
set?

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


Above is the code

So say I have 20 more fields that need to be set I was
trying

UPDATE Final INNER JOIN [From] ON [Final].[CaseID] =
[From].[CaseID] SET Final.Journals = [Final].[Journals]
+": " &"- "& [From].[Journals] & Final.EntryDate = [From].
[EntryDate] & Final.Region = [From].[Region]
WHERE (((From.Journals) Is Not Null));

I have more than this but when I run this it says it is
updating the table but doesn't, and I don't get any error
messages


.
.
 

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