Need to copy from a field to another

  • Thread starter Thread starter Telesphore
  • Start date Start date
T

Telesphore

In a table with a query I need to copy all names of different societies from
a field to another:
II([DepartmentName]="Society*";[CompanyName]";"") ???

With this expression it doesn't work

Thank you
 
In a table with a query I need to copy all names of different societies from
a field to another:
II([DepartmentName]="Society*";[CompanyName]";"") ???

With this expression it doesn't work

Thank you

Ummm... why would it?

IIF doesn't update anything.It returns either a company name or a
blank.

What field do you want to update? What do you want it updated TO?
Under what conditions do you want it updated?

An UPDATE query (with no IIF's) will be the proper tool, but I can't
make out from your II function (by which I guess you meant IIf) what
it is that you want to happen!

John W. Vinson[MVP]
 
I recognize that I was doing the wrong thing.

I want to copy all names of a field beginning with the word "Society" in
another field

May be I could do something like this in the criteria:

WHERE (([DepartmentName] Between "Society A*" And "Society Z*"))

Thank again.

John Vinson" said:
wrote:
In a table with a query I need to copy all names of different societies
from
a field to another:
II([DepartmentName]="Society*";[CompanyName]";"") ???

With this expression it doesn't work

Thank you

Ummm... why would it?

IIF doesn't update anything.It returns either a company name or a
blank.

What field do you want to update? What do you want it updated TO?
Under what conditions do you want it updated?

An UPDATE query (with no IIF's) will be the proper tool, but I can't
make out from your II function (by which I guess you meant IIf) what
it is that you want to happen!

John W. Vinson[MVP]
 
I recognize that I was doing the wrong thing.

I want to copy all names of a field beginning with the word "Society" in
another field

I'm sorry, I'm still in a fog here...

You want to copy WHAT? From *which* field? Into which *other* field?
May be I could do something like this in the criteria:

WHERE (([DepartmentName] Between "Society A*" And "Society Z*"))

The criteria you cite would be fine, but so would

WHERE [DepartmentName] LIKE "Society*"

ALl that does is select which records will be chosen for updating. I
still don't know how to tell you how to phrase the Update clause,
because I don't know which field you're updating, or what value you
are updating it to.

John W. Vinson[MVP]
 
Sorry for the confusion.

I have a field named Department and another field named Company.

The Department field is populated with different names. I want to copy all
the names beginning with the word "Society..." to the field Company.

In SQL view it could be like this:

UPDATE tblOrganisation SET tblOrganisation.Company = [Department]
WHERE (((tblOrganisation.Department) Between "Society A" And "Society Z"));


HTH

Thanks again.

John Vinson" said:
I'm sorry, I'm still in a fog here...

You want to copy WHAT? From *which* field? Into which *other* field?
May be I could do something like this in the criteria:

WHERE (([DepartmentName] Between "Society A*" And "Society Z*"))

The criteria you cite would be fine, but so would

WHERE [DepartmentName] LIKE "Society*"

ALl that does is select which records will be chosen for updating. I
still don't know how to tell you how to phrase the Update clause,
because I don't know which field you're updating, or what value you
are updating it to.

John W. Vinson[MVP]
 
Telesphore said:
Sorry for the confusion.

I have a field named Department and another field named Company.

The Department field is populated with different names. I want to
copy all the names beginning with the word "Society..." to the field
Company.
In SQL view it could be like this:

UPDATE tblOrganisation SET tblOrganisation.Company = [Department]
WHERE (((tblOrganisation.Department) Between "Society A" And "Society
Z"));

And what happens when you run that query? It should work as written except that
Access might insist on the table qualifier in the assignment.

UPDATE tblOrganisation SET tblOrganisation.Company = tblOrganisation.Department
WHERE tblOrganisation.Department Like "Society*"
 
Thank you very much

Your code <UPDATE tblOrganisation SET tblOrganisation.Company =
tblOrganisation.Department
WHERE tblOrganisation.Department Like "Society*">
did the best. Mine had left some society names not copied.

"Rick Brandt"
Telesphore said:
Sorry for the confusion.

I have a field named Department and another field named Company.

The Department field is populated with different names. I want to
copy all the names beginning with the word "Society..." to the field
Company.
In SQL view it could be like this:

UPDATE tblOrganisation SET tblOrganisation.Company = [Department]
WHERE (((tblOrganisation.Department) Between "Society A" And "Society
Z"));

And what happens when you run that query? It should work as written
except that Access might insist on the table qualifier in the assignment.

UPDATE tblOrganisation SET tblOrganisation.Company =
tblOrganisation.Department
WHERE tblOrganisation.Department Like "Society*"
 
Back
Top