By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

How do I trim a number from 13 digits to 12 using a query?

P: n/a
Hi

i am converting some data in our POS System which currently uses 13
digits for UPC codes (eg 0000000001234) however our Barcode software
requires the UPC to be 12 digits (000000001234) I would like to run a
querie that can take all of the current UPC's in our system and place
them in a new table with the extra zero removed from the front of the
upc. How can I do this the easiest? My tables are as follows

Products (tablename)
UPC

Barcode (tablename)
UPC

As mentioned above I just need to trim the furthest left 0 from the
results.
Thanks

Shannon
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 19 Jan 2004 14:40:58 -0800, sh*****@cybertram.com (Shannon Scheer) wrote:
Hi

i am converting some data in our POS System which currently uses 13
digits for UPC codes (eg 0000000001234) however our Barcode software
requires the UPC to be 12 digits (000000001234) I would like to run a
querie that can take all of the current UPC's in our system and place
them in a new table with the extra zero removed from the front of the
upc. How can I do this the easiest? My tables are as follows

Products (tablename)
UPC

Barcode (tablename)
UPC

As mentioned above I just need to trim the furthest left 0 from the
results.
Thanks

Shannon


If it is a given that the first character is always a zero (and I'm not sure
how you would handle it if it's not), then you just need Mid(UPC,2). That
returns the substring starting at position 2, and (since the length argument
is omitted) continuing to the end of the string.
Nov 12 '05 #2

P: n/a
Steve Jorgensen <no****@nospam.nospam> wrote in message news:<0k********************************@4ax.com>. ..
On 19 Jan 2004 14:40:58 -0800, sh*****@cybertram.com (Shannon Scheer) wrote:
Hi

i am converting some data in our POS System which currently uses 13
digits for UPC codes (eg 0000000001234) however our Barcode software
requires the UPC to be 12 digits (000000001234) I would like to run a
querie that can take all of the current UPC's in our system and place
them in a new table with the extra zero removed from the front of the
upc. How can I do this the easiest? My tables are as follows

Products (tablename)
UPC

Barcode (tablename)
UPC

As mentioned above I just need to trim the furthest left 0 from the
results.
Thanks

Shannon


If it is a given that the first character is always a zero (and I'm not sure
how you would handle it if it's not), then you just need Mid(UPC,2). That
returns the substring starting at position 2, and (since the length argument
is omitted) continuing to the end of the string.


That worked like a charm!! THANKS
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.