PC Review


Reply
Thread Tools Rate Thread

Access functions

 
 
=?Utf-8?B?SmVhbm5lIFQ=?=
Guest
Posts: n/a
 
      26th Oct 2007
Which function do I use if I want to take out leading characters in a number?

Ex: "000192000" I want to display "92000", so I want to take out the
"0001" from all the records?
 
Reply With Quote
 
 
 
 
Kerry
Guest
Posts: n/a
 
      26th Oct 2007
Is it always the first 4 characters you want to remove? Are you sure
this is a number? Since you have leading 0's, I suspect it is text.

If this is a text field you want to remove the 4 leading characters
then use the mid function:

Mid([Field Name],5)

On Oct 26, 8:49 am, Jeanne T <Jeanne T...@discussions.microsoft.com>
wrote:
> Which function do I use if I want to take out leading characters in a number?
>
> Ex: "000192000" I want to display "92000", so I want to take out the
> "0001" from all the records?



 
Reply With Quote
 
=?Utf-8?B?TGFuY2U=?=
Guest
Posts: n/a
 
      26th Oct 2007
There are a couple functions that could accomplish this, each providing a
different approach which may be needed depending on how your data is set up.

Right("000192000", 5) 'Return rightmost 5 characters of the string

Mid("000192000", 5) 'Return all characters, starting from the 5th
character in the string

If you're going to have variable numbers of leading characters, use the
right function. If you're going to have variable numbers of characters you
want to keep, but the "prefix" will always be the same length use the mid
function.

If it's always going to be a static number of characters.. either will work
just as well as the other.

"Jeanne T" wrote:

> Which function do I use if I want to take out leading characters in a number?
>
> Ex: "000192000" I want to display "92000", so I want to take out the
> "0001" from all the records?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions worked in Access 2003 but not in Access 2007 Tom C Microsoft Access Macros 4 16th Aug 2008 12:37 AM
Access 2003 treats embedded functions in nested queries as a reference rather than a value - Access 2007? jgfaughnan Microsoft Access Queries 2 9th Jun 2007 08:16 PM
Converting Oracle SQL functions to Access built-in functions GVR_Mike Microsoft Access 3 30th Jun 2006 12:33 AM
Functions in Access 2000 not in Access 2003 mcl Microsoft Access Queries 3 5th Jan 2006 03:57 PM
Data Access Pages and Calling ACCESS functions =?Utf-8?B?VmFsdWVkQ2xpZW50?= Microsoft Access VBA Modules 1 16th Feb 2005 04:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:35 PM.