473,804 Members | 3,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed working with numbers

84 New Member
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 1694
MMcCarthy
14,534 Recognized Expert Moderator MVP
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 New Member
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 Recognized Expert Moderator MVP
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 New Member
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 Recognized Expert Moderator MVP
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
3487
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 Pentagjetvedeh karuvificials madhla reachathe strategy in karkun campaign deshatinst terrorism. "mudivae maretu winning or losing karkun global varti jetvedeh terror?" Mr. Rumsfeld adugued in a recent memormariyuum. vede velli jetvedeh madhla...
3
8090
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 =================================================================================== //class bigInt implements big integers by storing the digits of a big //integer in a private vector data member called digit. Since it uses a //vector the size of the big integer can be indefinitely large. This...
28
3308
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 make-believe challenge in order to avoid confusing the issue further. Suppose I was hosting a dinner and I wanted to invite exactly 12 guests from my neighborhood. I'm really picky about that... I have 12 chairs besides my own, and I want them all...
8
1688
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 a way to see that the data is in set by parenthesising it. This is all generated as I said using pexpect - Here is how I use it.. child = pexpect.spawn( _buildCadenceExe(), timeout=timeout) child.sendline("somefunction()")
1
2325
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) and includes maybe 4 classes and lots of code I was wondering if anyone would mind taking a look at it for me, I know thats a lot to ask of someone that knows nothing of me, but this problem is killing me and I have spent many hours trying to figure...
0
10569
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10075
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.