473,394 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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
2 2059
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: jose luis fernandez diaz | last post by:
Hi, My OS is: cronos:jdiaz:tmp>uname -a HP-UX cronos B.11.11 U 9000/800 820960681 unlimited-user license I compile in 64-bits mode the program below:
5
by: Dave Bovey | last post by:
I created a church database in Access 97 that contain the typical Name, Address, and Phone Number information fields. I had a number of different reports to print query data in different formats. ...
3
by: Andy B | last post by:
I've tried using Trim or RTrim to strip trailing space characters from my data. When I check on the transformed data space characters are still there. We have an address table containing two...
1
by: Shreyas Kulkarni | last post by:
hi there, recently i have got a problem regarding calculation of sum of digits in a floating point or precision number. the weird behaviour of compiler/language is preventing me from calculating...
27
by: Luke Wu | last post by:
Is there a C function that returns the number of digits in an input int/long? example: numdigits(123) returns 3 numdigits(1232132) returns 7
15
by: Orchid | last post by:
Hello, I am looking to generate a unique ID field on MS. Access. The ID is with 10 digits with the combination of 5 Letters from the 26 letters and 5 Numbers from 1 to 9. The letters and numbers...
109
by: jmcgill | last post by:
Hello. Is there a method for computing the number of digits, in a given numeric base, of N factorial, without actually computing the factorial? For example, 8! has 5 digits in base 10; 10! has...
3
by: jgscott3 | last post by:
All, I have the following expression in a query: Switch(>=10121 And <=10135,&"xxx") (There are other expresions within Switch, but this is the one in question.) I need to evaluate as a...
19
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
This is an example of the data; 2007/07/27 11:00:03 ARES_INDICATION 010.050.016.002 404.2.01 (6511) RX 74 bytes 2007/07/27 11:00:03 65 11 26 02 BC 6C AA 20 76 93 51 53 50 76 13 48...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.