Changing column name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to run a query with a calculation that can change the following

Sample Location
BH 3 = Borehole 03
BH 4 = Borehole 04
BH 5 = Borehole 05
.....
BH 11 = Borehole 11

Thank you
 
Use a Calculated Field in your Query:

NewCode: "Borehole " & Format( CInt(Mid([OldCode], 4) ), "00" )
 
Wow Thank you!

How do you know how to do that?


Van T. Dinh said:
Use a Calculated Field in your Query:

NewCode: "Borehole " & Format( CInt(Mid([OldCode], 4) ), "00" )

--
HTH
Van T. Dinh
MVP (Access)


KIM said:
Is it possible to run a query with a calculation that can change the following

Sample Location
BH 3 = Borehole 03
BH 4 = Borehole 04
BH 5 = Borehole 05
....
BH 11 = Borehole 11

Thank you
 
Next question - I've just realised that some of the queries have the
following names

BH 15 = Borehole 15 works with below code
BH 16 = Borehole 16 works with below code
BH 54/1 = Borehole 54/1 error
BH 54/2 = Borehole 52/2 error

Can I get round this?

Thank you

Van T. Dinh said:
Use a Calculated Field in your Query:

NewCode: "Borehole " & Format( CInt(Mid([OldCode], 4) ), "00" )

--
HTH
Van T. Dinh
MVP (Access)


KIM said:
Is it possible to run a query with a calculation that can change the following

Sample Location
BH 3 = Borehole 03
BH 4 = Borehole 04
BH 5 = Borehole 05
....
BH 11 = Borehole 11

Thank you
 
Once you know some basic functions in VBA, you can analyze the requirement
and design a suitable expression.
 
What is the size and name of the field that contains the data BH*

KIM said:
Next question - I've just realised that some of the queries have the
following names

BH 15 = Borehole 15 works with below code
BH 16 = Borehole 16 works with below code
BH 54/1 = Borehole 54/1 error
BH 54/2 = Borehole 52/2 error

Can I get round this?

Thank you

Van T. Dinh said:
Use a Calculated Field in your Query:

NewCode: "Borehole " & Format( CInt(Mid([OldCode], 4) ), "00" )

--
HTH
Van T. Dinh
MVP (Access)


KIM said:
Is it possible to run a query with a calculation that can change the following

Sample Location
BH 3 = Borehole 03
BH 4 = Borehole 04
BH 5 = Borehole 05
....
BH 11 = Borehole 11

Thank you
 
Jumping in on Van T. Dinh's reply.

NewCode: "Borehole " & Mid([OldCode],4)

That should work for you.
Next question - I've just realised that some of the queries have the
following names

BH 15 = Borehole 15 works with below code
BH 16 = Borehole 16 works with below code
BH 54/1 = Borehole 54/1 error
BH 54/2 = Borehole 52/2 error

Can I get round this?

Thank you

Van T. Dinh said:
Use a Calculated Field in your Query:

NewCode: "Borehole " & Format( CInt(Mid([OldCode], 4) ), "00" )

--
HTH
Van T. Dinh
MVP (Access)


KIM said:
Is it possible to run a query with a calculation that can change the following

Sample Location
BH 3 = Borehole 03
BH 4 = Borehole 04
BH 5 = Borehole 05
....
BH 11 = Borehole 11

Thank you
 
Cancel that, I just reread your request. I also see you got a response that
solved this problem in another thread.

John Spencer (MVP) said:
Jumping in on Van T. Dinh's reply.

NewCode: "Borehole " & Mid([OldCode],4)

That should work for you.
Next question - I've just realised that some of the queries have the
following names

BH 15 = Borehole 15 works with below code
BH 16 = Borehole 16 works with below code
BH 54/1 = Borehole 54/1 error
BH 54/2 = Borehole 52/2 error

Can I get round this?

Thank you

Van T. Dinh said:
Use a Calculated Field in your Query:

NewCode: "Borehole " & Format( CInt(Mid([OldCode], 4) ), "00" )

--
HTH
Van T. Dinh
MVP (Access)


Is it possible to run a query with a calculation that can change the
following

Sample Location
BH 3 = Borehole 03
BH 4 = Borehole 04
BH 5 = Borehole 05
....
BH 11 = Borehole 11

Thank you
 
Back
Top