473,322 Members | 1,379 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,322 software developers and data experts.

Help needed working with numbers

84
I have a database field that stores 8 and 9 digit values. I need to calculate the sum value using the first 8 digits.

ex.of stored numbers
123456781
234567892
45678903
987654321
calculation should use
12345678
23456789
_4567890
98765432

My current query statement takes the first 8 of the 9 digit numbers and it takes all 8 of the eight digit numbers. Left(Account,8).

Is there a way to alter the statement so it takes the first 8 digits of the 9 digit numbers and inserts a leading 0 or blank space for the 8 digit numbers?
Mar 13 '07 #1
5 1642
MMcCarthy
14,534 Expert Mod 8TB
I have a database field that stores 8 and 9 digit values. I need to calculate the sum value using the first 8 digits.

ex.of stored numbers
123456781
234567892
45678903
987654321
calculation should use
12345678
23456789
_4567890
98765432

My current query statement takes the first 8 of the 9 digit numbers and it takes all 8 of the eight digit numbers. Left(Account,8).

Is there a way to alter the statement so it takes the first 8 digits of the 9 digit numbers and inserts a leading 0 or blank space for the 8 digit numbers?
Format the numbers in the table design as

000000000

This will put a leading 0 on all numbers with only 8 digits.

Mary
Mar 14 '07 #2
sesling
84
Format the numbers in the table design as

000000000

This will put a leading 0 on all numbers with only 8 digits.

Mary

Thx for the hint but I cannot change the table design. Other processes in our DB need the 8 and 9 digit numbers. Are there any other options?
Mar 14 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Format the numbers in the table design as

000000000

This will put a leading 0 on all numbers with only 8 digits.

Mary
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Left(Format([Account],"000000000"),8)
Mary
Mar 14 '07 #4
sesling
84
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Left(Format([Account],"000000000"),8)
Mary

GREAT!. That worked. Thank you :)
Mar 14 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
GREAT!. That worked. Thank you :)
You're welcome.
Mar 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
3
by: KK | last post by:
Hi, im working on this bigInt class. Need help writing algorithm for the operator*, andy help will be appreciated. Thanks in advance bigInt.h...
28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
8
by: rh0dium | last post by:
Hi all, I am using python to drive another tool using pexpect. The values which I get back I would like to automatically put into a list if there is more than one return value. They provide me...
1
by: AlmasKhan01 | last post by:
Hi I have been for sometime now been working on a MineSweeper program and I'm 90% complete on it it involves a window interface and is quite simple but the issue is not. The program is long(to me)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.