Access function same as Excel's TEXT function???

G

Guest

Hello,
I need to find a way to replicate what Excel does with the Text function. I
have two numeric pieces of data that need to sandwich some text. The output
would look like:

13.42% dec: 8

In Excel, I would use:
=TEXT(_5_yr_Return,"00.00%")&" dec:
"&TEXT(INT((_5_yr_Return_Percentile-1)/10)+1,"0")

Any help will be very much appreciated.
 
G

Guest

Directly from Access Help:

TotalLine: "Total number of items: "&[Total] Displays in the TotalLine field
the string "Total number of items: 10," if the Total field contains the value
10.

This can be put into a calculated field in a query.

Jeff
 
J

John Vinson

Hello,
I need to find a way to replicate what Excel does with the Text function. I
have two numeric pieces of data that need to sandwich some text. The output
would look like:

13.42% dec: 8

In Excel, I would use:
=TEXT(_5_yr_Return,"00.00%")&" dec:
"&TEXT(INT((_5_yr_Return_Percentile-1)/10)+1,"0")

Any help will be very much appreciated.

I think the Format() function is what you want. If you have a table
field (very oddly) named _5_yr_return you can use, for example,

ShowField: Format([_5_yr_return], "00.00%") & " dec:" & Format(...


John W. Vinson[MVP]
 
G

Guest

Jeff,

I must be missing something with what you said since the point of my post
was to be able to put together numbers and text into one string while having
the numbers formatted with a specific number of decimal points similar to
what Excel's TEXT function does.

Since your suggestion did not include any formatting functionality for
non-integers as I humbly requested, what you seem to be indicating is that I
not use my original:
=TEXT(_5_yr_Return,"00.00%")&" dec:
"&TEXT(INT((_5_yr_Return_Percentile-1)/10)+1,"0")
but rather:
=[_5_yr_Return]&" dec: "&INT((_5_yr_Return_Percentile-1)/10)+1)
which would give me:
0.134251357 dec: 8.2342475
instead of the desired
13.42% dec: 8

If I misinterpreted your response due to my extreme lack of knowledge
regarding Access, I sincerely apologize. However, when someone starts a
reply to a semi-novice (who does indeed check the help files, KB, plus this
and other Access forums before wasting the time of Access gurus like you)
with the not-so-subtle putdown of "Directly from Access Help" yet doesn't
even seem to properly understand the point of the post, I begin to wonder
whether your exit strategy from bed this morning did indeed involve the
incorrect side (as might have been the case with me) too.

Have nice day!


Jeff Shanker said:
Directly from Access Help:

TotalLine: "Total number of items: "&[Total] Displays in the TotalLine field
the string "Total number of items: 10," if the Total field contains the value
10.

This can be put into a calculated field in a query.

Jeff

PZ Straube said:
Hello,
I need to find a way to replicate what Excel does with the Text function. I
have two numeric pieces of data that need to sandwich some text. The output
would look like:

13.42% dec: 8

In Excel, I would use:
=TEXT(_5_yr_Return,"00.00%")&" dec:
"&TEXT(INT((_5_yr_Return_Percentile-1)/10)+1,"0")

Any help will be very much appreciated.
 
G

Guest

John,
Perfect! That's exactly what I needed.
Yes, the field name is odd but that's how it comes from the data provider.
I could have a properly-named field pick the up data but I have just left it
as-is for now.
Thanks again!

John Vinson said:
Hello,
I need to find a way to replicate what Excel does with the Text function. I
have two numeric pieces of data that need to sandwich some text. The output
would look like:

13.42% dec: 8

In Excel, I would use:
=TEXT(_5_yr_Return,"00.00%")&" dec:
"&TEXT(INT((_5_yr_Return_Percentile-1)/10)+1,"0")

Any help will be very much appreciated.

I think the Format() function is what you want. If you have a table
field (very oddly) named _5_yr_return you can use, for example,

ShowField: Format([_5_yr_return], "00.00%") & " dec:" & Format(...


John W. Vinson[MVP]
 

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