Changing from capital to small letters

  • Thread starter Thread starter Dimitris
  • Start date Start date
D

Dimitris

Hello I have a table in which there is a field LNAME in which last names
have been entered with capitol letters. For example: SMITH.
I want to change them to small letters except the first one, so it will
become: Smith
Is it possible?

Thank you
Dimitris
 
Dimitris,
Just an minor addition to Ed's correct response. It's the best you can
do for automating the solution to your poblem
Be aware though, that names like...
MCCARTHY
would come out as
Mccarthy
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
Thank you for your answers.
I just can't figure where to write it.
I made a querie and wrote it at the SQL view but wasn;t accepted.
Please tell me where to write it. What steps should I do?
Thank You
Dimitris
 
Open a new query window in design view.
Add the table with the field of interest
add the field LNAME
in the next box over add the following
LnameProperCase: StrConv([LNAME], vbProperCase)
run the query to see the results.

If after you see what the code does to the fields, and you like it, and you
want to change the stored data.
Then
change the query type to update
copy the code: StrConv([LNAME], vbProperCase) into the updateto box under
the LNAME field, run the query.

Ed Warren
 
Ed,
As far as I know, queris don't recognize the visual basic constants, so you
have to specify the actual value.

Therefore StrConv([LNAME], vbProperCase) should be StrConv([LName],3)



Ed Warren said:
Open a new query window in design view.
Add the table with the field of interest
add the field LNAME
in the next box over add the following
LnameProperCase: StrConv([LNAME], vbProperCase)
run the query to see the results.

If after you see what the code does to the fields, and you like it, and
you want to change the stored data.
Then
change the query type to update
copy the code: StrConv([LNAME], vbProperCase) into the updateto box under
the LNAME field, run the query.

Ed Warren

Dimitris said:
Thank you for your answers.
I just can't figure where to write it.
I made a querie and wrote it at the SQL view but wasn;t accepted.
Please tell me where to write it. What steps should I do?
Thank You
Dimitris
 
Yes you are correct replace the constant vbProperCase with the number 3

Thanks,

Ed Warren

John Spencer said:
Ed,
As far as I know, queris don't recognize the visual basic constants, so
you have to specify the actual value.

Therefore StrConv([LNAME], vbProperCase) should be StrConv([LName],3)



Ed Warren said:
Open a new query window in design view.
Add the table with the field of interest
add the field LNAME
in the next box over add the following
LnameProperCase: StrConv([LNAME], vbProperCase)
run the query to see the results.

If after you see what the code does to the fields, and you like it, and
you want to change the stored data.
Then
change the query type to update
copy the code: StrConv([LNAME], vbProperCase) into the updateto box
under the LNAME field, run the query.

Ed Warren

Dimitris said:
Thank you for your answers.
I just can't figure where to write it.
I made a querie and wrote it at the SQL view but wasn;t accepted.
Please tell me where to write it. What steps should I do?
Thank You
Dimitris


Dimitris,
Just an minor addition to Ed's correct response. It's the best you
can do for automating the solution to your poblem
Be aware though, that names like...
MCCARTHY
would come out as
Mccarthy
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Hello I have a table in which there is a field LNAME in which last
names have been entered with capitol letters. For example: SMITH.
I want to change them to small letters except the first one, so it
will become: Smith
Is it possible?

Thank you
Dimitris
 
Thank you all,
It worked fine, I am very happy about this.
Only one issue which has to do with the Greek grammar and it won't make
sense if I explain it. I just have to do this. After using the code you told
me I have to change the last letter of some names. To stay at my first
example "SMITH" became "Smith" but how can I change now the "h" at the end
of "Smith" with another letter. I need to change ALL the letters "h" at THE
END of names only.
So in my mind it's something like: Wherever a name ends with "h" change it
with "c" for example. Well in Greek we have 2 possibilities for a letter so
I need to change it to the other one, that is why I need this.
Thank you in advance
Dimitris


Ed Warren said:
Yes you are correct replace the constant vbProperCase with the number 3

Thanks,

Ed Warren

John Spencer said:
Ed,
As far as I know, queris don't recognize the visual basic constants, so
you have to specify the actual value.

Therefore StrConv([LNAME], vbProperCase) should be StrConv([LName],3)



Ed Warren said:
Open a new query window in design view.
Add the table with the field of interest
add the field LNAME
in the next box over add the following
LnameProperCase: StrConv([LNAME], vbProperCase)
run the query to see the results.

If after you see what the code does to the fields, and you like it, and
you want to change the stored data.
Then
change the query type to update
copy the code: StrConv([LNAME], vbProperCase) into the updateto box
under the LNAME field, run the query.

Ed Warren

Thank you for your answers.
I just can't figure where to write it.
I made a querie and wrote it at the SQL view but wasn;t accepted.
Please tell me where to write it. What steps should I do?
Thank You
Dimitris


Dimitris,
Just an minor addition to Ed's correct response. It's the best you
can do for automating the solution to your poblem
Be aware though, that names like...
MCCARTHY
would come out as
Mccarthy
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Hello I have a table in which there is a field LNAME in which last
names have been entered with capitol letters. For example: SMITH.
I want to change them to small letters except the first one, so it
will become: Smith
Is it possible?

Thank you
Dimitris
 
So in my mind it's something like: Wherever a name ends with "h" change it with "c"
for example. Well in Greek we have 2 possibilities for a letter so I need to change
it to the other one, that is why I need this.
Thank you in advance
Dimitris

IIf(Right([TestString], 1) = "h", Left([TestString], Len([TestString]) - 1) & "c",
[TestString])

Tom Lake
 
Thanks Tom,

It didn't work. I created an update querie and wrote it in the "Update to"
line. But a window appears asking me to write what [TestString] is.
Can you please tell me what I am supposed to do and where I should write it?
Dimitris

Tom Lake said:
So in my mind it's something like: Wherever a name ends with "h" change
it with "c" for example. Well in Greek we have 2 possibilities for a
letter so I need to change it to the other one, that is why I need this.
Thank you in advance
Dimitris

IIf(Right([TestString], 1) = "h", Left([TestString], Len([TestString]) -
1) & "c", [TestString])

Tom Lake
 
Dimitris,

Since you seem to be using the query grid, Try the following after you
BACKUP your data - queries are not undoable.

Field: LName
Criteria: LIKE "*h"
Update To: Left([Lname],Len([Lname])-1) & "c"


Dimitris said:
Thanks Tom,

It didn't work. I created an update querie and wrote it in the "Update to"
line. But a window appears asking me to write what [TestString] is.
Can you please tell me what I am supposed to do and where I should write
it?
Dimitris

Tom Lake said:
So in my mind it's something like: Wherever a name ends with "h" change
it with "c" for example. Well in Greek we have 2 possibilities for a
letter so I need to change it to the other one, that is why I need this.
Thank you in advance
Dimitris

IIf(Right([TestString], 1) = "h", Left([TestString], Len([TestString]) -
1) & "c", [TestString])

Tom Lake
 
Thanks John
It worked fine.


John Spencer said:
Dimitris,

Since you seem to be using the query grid, Try the following after you
BACKUP your data - queries are not undoable.

Field: LName
Criteria: LIKE "*h"
Update To: Left([Lname],Len([Lname])-1) & "c"


Dimitris said:
Thanks Tom,

It didn't work. I created an update querie and wrote it in the "Update
to" line. But a window appears asking me to write what [TestString] is.
Can you please tell me what I am supposed to do and where I should write
it?
Dimitris

Tom Lake said:
So in my mind it's something like: Wherever a name ends with "h" change
it with "c" for example. Well in Greek we have 2 possibilities for a
letter so I need to change it to the other one, that is why I need
this.
Thank you in advance
Dimitris

IIf(Right([TestString], 1) = "h", Left([TestString], Len([TestString]) -
1) & "c", [TestString])

Tom Lake
 

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

Back
Top