right function

  • Thread starter Thread starter Rodrigo
  • Start date Start date
R

Rodrigo

Hi,

I know this is an access newsgroup, but I can't seem to find help in other
newsgroups. If anyone knows how to do this I'll appreciate the help.

I have the following table pulling data from an xml file. I can't change the
xml file as it means changing the program that created it (big project),
however I can change the web page.

What I have on the xml file is 6 digit account number. But I only need to
show on the web page the last 2 digits. I looked, and looked and still can't
find anything that would do this for me. In most programming languages there
is a function that would do this for me (newtext=right(mytext,2)). But I
can't seem to find anything for this (that plus searching for "right
function" gives you back 1,000... or records). All it shows is the full 6
digits.

Could anyone help.
<!--Acct Number-->

<TABLE width="448" DATASRC="#Accounts">

<tr>

<TD><SPAN DATAFLD="AccountNumber"></SPAN></TD>

</tr>

</TABLE>



Thanks,



Rodrigo.
 
What I have on the xml file is 6 digit account number. But I only need to
show on the web page the last 2 digits.

use javascript (please direct the question to the appropriate newsgroup in
the future).

<html>

<body>
<script language="javascript">
function strip_right(str, cnt) {
return str.substr(str.length-cnt, cnt);
}
</script>
<p>Account#: <script>document.write(strip_right("123456", 2))</script>
</body>
</html>

-- Dev
 
Back
Top