Changing Numbers to Text in a query

  • Thread starter Thread starter MacNut2004
  • Start date Start date
M

MacNut2004

Hello,

I have a number in a query that i need to change to text because my data,
i.e. 555767 is being returned as 555,767 and i do not want it to contain a
comma. Any ideas?

Thank you!
MN
 
Perhaps you only need to change the "display" of the number, not the data
type...?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Well, I need to export the results of this query to excel so it needs to be
changed to text...any ideas?
 
Try the CStr() function in your query.

(but if you tell Excel that "100,000" is "text", you won't be able to do
math on it!)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
no worries....i don't want to do math on that. ahh, it didn't work! is there
a command in VBA that can change the number to text?

thank you!!!
 
The following works for me:

* create a query
* add a field with a number data type
* create a new field, something like: NewField: CStr([YourField])

This creates a text (string) of whatever was in [YourField]

Works for me...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
no worries....i don't want to do math on that. ahh, it didn't work! is there
a command in VBA that can change the number to text?

Yes:

strNumber = Format([numberfield], #)

John W. Vinson [MVP]
 
If you still have trouble then try this ---
NewField: "'" & CStr([YourField])
This concatenates a single quote in front and Excel treats it as a text and
does not display the single quote.
--
KARL DEWEY
Build a little - Test a little


Jeff Boyce said:
The following works for me:

* create a query
* add a field with a number data type
* create a new field, something like: NewField: CStr([YourField])

This creates a text (string) of whatever was in [YourField]

Works for me...

Regards

Jeff Boyce
Microsoft Office/Access MVP

MacNut2004 said:
no worries....i don't want to do math on that. ahh, it didn't work! is
there
a command in VBA that can change the number to text?

thank you!!!
 
Jeff & Karl,

Neither way is working! It's still coming up with a comma! Anyway in VBA
to do this? I am coming up with this value using vba code and the split
function.

KARL DEWEY said:
If you still have trouble then try this ---
NewField: "'" & CStr([YourField])
This concatenates a single quote in front and Excel treats it as a text and
does not display the single quote.
--
KARL DEWEY
Build a little - Test a little


Jeff Boyce said:
The following works for me:

* create a query
* add a field with a number data type
* create a new field, something like: NewField: CStr([YourField])

This creates a text (string) of whatever was in [YourField]

Works for me...

Regards

Jeff Boyce
Microsoft Office/Access MVP

MacNut2004 said:
no worries....i don't want to do math on that. ahh, it didn't work! is
there
a command in VBA that can change the number to text?

thank you!!!

:

Try the CStr() function in your query.

(but if you tell Excel that "100,000" is "text", you won't be able to do
math on it!)

Regards

Jeff Boyce
Microsoft Office/Access MVP

Well, I need to export the results of this query to excel so it needs
to
be
changed to text...any ideas?

:

Perhaps you only need to change the "display" of the number, not the
data
type...?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hello,

I have a number in a query that i need to change to text because my
data,
i.e. 555767 is being returned as 555,767 and i do not want it to
contain a
comma. Any ideas?

Thank you!
MN
 
Have you tried John V's approach?

Regards

Jeff Boyce
Microsoft Office/Access MVP

MacNut2004 said:
Jeff & Karl,

Neither way is working! It's still coming up with a comma! Anyway in VBA
to do this? I am coming up with this value using vba code and the split
function.

KARL DEWEY said:
If you still have trouble then try this ---
NewField: "'" & CStr([YourField])
This concatenates a single quote in front and Excel treats it as a text
and
does not display the single quote.
--
KARL DEWEY
Build a little - Test a little


Jeff Boyce said:
The following works for me:

* create a query
* add a field with a number data type
* create a new field, something like: NewField: CStr([YourField])

This creates a text (string) of whatever was in [YourField]

Works for me...

Regards

Jeff Boyce
Microsoft Office/Access MVP

no worries....i don't want to do math on that. ahh, it didn't work!
is
there
a command in VBA that can change the number to text?

thank you!!!

:

Try the CStr() function in your query.

(but if you tell Excel that "100,000" is "text", you won't be able
to do
math on it!)

Regards

Jeff Boyce
Microsoft Office/Access MVP

Well, I need to export the results of this query to excel so it
needs
to
be
changed to text...any ideas?

:

Perhaps you only need to change the "display" of the number, not
the
data
type...?

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
Hello,

I have a number in a query that i need to change to text
because my
data,
i.e. 555767 is being returned as 555,767 and i do not want it
to
contain a
comma. Any ideas?

Thank you!
MN
 
What is John V's approach? I tried both your approach and Karl's.

Thx,
MN

Jeff Boyce said:
Have you tried John V's approach?

Regards

Jeff Boyce
Microsoft Office/Access MVP

MacNut2004 said:
Jeff & Karl,

Neither way is working! It's still coming up with a comma! Anyway in VBA
to do this? I am coming up with this value using vba code and the split
function.

KARL DEWEY said:
If you still have trouble then try this ---
NewField: "'" & CStr([YourField])
This concatenates a single quote in front and Excel treats it as a text
and
does not display the single quote.
--
KARL DEWEY
Build a little - Test a little


:

The following works for me:

* create a query
* add a field with a number data type
* create a new field, something like: NewField: CStr([YourField])

This creates a text (string) of whatever was in [YourField]

Works for me...

Regards

Jeff Boyce
Microsoft Office/Access MVP

no worries....i don't want to do math on that. ahh, it didn't work!
is
there
a command in VBA that can change the number to text?

thank you!!!

:

Try the CStr() function in your query.

(but if you tell Excel that "100,000" is "text", you won't be able
to do
math on it!)

Regards

Jeff Boyce
Microsoft Office/Access MVP

Well, I need to export the results of this query to excel so it
needs
to
be
changed to text...any ideas?

:

Perhaps you only need to change the "display" of the number, not
the
data
type...?

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
Hello,

I have a number in a query that i need to change to text
because my
data,
i.e. 555767 is being returned as 555,767 and i do not want it
to
contain a
comma. Any ideas?

Thank you!
MN
 
In my view of this thread, John W. Vinson responded to your post at 11:11 am
today.

Regards

Jeff Boyce
Microsoft Office/Access MVP

MacNut2004 said:
What is John V's approach? I tried both your approach and Karl's.

Thx,
MN

Jeff Boyce said:
Have you tried John V's approach?

Regards

Jeff Boyce
Microsoft Office/Access MVP

MacNut2004 said:
Jeff & Karl,

Neither way is working! It's still coming up with a comma! Anyway in
VBA
to do this? I am coming up with this value using vba code and the split
function.

:

If you still have trouble then try this ---
NewField: "'" & CStr([YourField])
This concatenates a single quote in front and Excel treats it as a
text
and
does not display the single quote.
--
KARL DEWEY
Build a little - Test a little


:

The following works for me:

* create a query
* add a field with a number data type
* create a new field, something like: NewField:
CStr([YourField])

This creates a text (string) of whatever was in [YourField]

Works for me...

Regards

Jeff Boyce
Microsoft Office/Access MVP

no worries....i don't want to do math on that. ahh, it didn't
work!
is
there
a command in VBA that can change the number to text?

thank you!!!

:

Try the CStr() function in your query.

(but if you tell Excel that "100,000" is "text", you won't be
able
to do
math on it!)

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
Well, I need to export the results of this query to excel so it
needs
to
be
changed to text...any ideas?

:

Perhaps you only need to change the "display" of the number,
not
the
data
type...?

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
Hello,

I have a number in a query that i need to change to text
because my
data,
i.e. 555767 is being returned as 555,767 and i do not want
it
to
contain a
comma. Any ideas?

Thank you!
MN
 

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