473,748 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combining numbers

Hi,
I'm attempting to create a query that will combine 2 columns of
numbers into one. The followng comes from 1 table with 4 fields
(A,B,C,D)

A B RESULT
700 000 700000
700 001 700001
700 002 700002
..
..
..
700 444 700444

c D RESULT
701 000 701000
701 001 701001
701 002 701002
..
..
..
701 444 701444

I have two problems that I need some some help with.

1. I'm having a problem in combining the numbers..when I try to
combine them using a expression ([A]+[b]) in a query, I get the
results of adding the two fields..not the combining them.

2. Once I can get the two fields combined, I'm going to have to sort
the whole thing as follows

700000
701000
700001
701001
700002
701002
..
..
..
700444
701444

I'm a beginner at using access...I realize it's potential, but little
things like this really trip me up.

Feel free to emai me with suggestions
Thanks,
Mark
Nov 13 '05 #1
5 2108
"M.Stanley" <ms********@hot mail.com> wrote in message
news:79******** *************** **@posting.goog le.com...
Hi,
I'm attempting to create a query that will combine 2 columns of
numbers into one. The followng comes from 1 table with 4 fields
(A,B,C,D)

A B RESULT
700 000 700000 [snip] I have two problems that I need some some help with.

1. I'm having a problem in combining the numbers..when I try to
combine them using a expression ([A]+[b]) in a query, I get the
results of adding the two fields..not the combining them.
In Access the operator for concatenating text is the & symbol. The + symbol can
be used if the data is clearly text (contains alpha characters), but as you have
found if the text contains only digits Access will assume that the + should be
applied as an arithmetic addition rather than concatenation.
2. Once I can get the two fields combined, I'm going to have to sort
the whole thing as follows

700000
701000


Once you have the desired output in the query simply add "Ascending" in the sort
row of the query design grid underneath the desired column.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
ms********@hotm ail.com (M.Stanley) wrote in
news:79******** *************** **@posting.goog le.com:
Hi,
I'm attempting to create a query that will combine 2 columns
of numbers into one. The followng comes from 1 table with 4
fields (A,B,C,D)

A B RESULT
700 000 700000
700 001 700001
700 002 700002
.
.
.
700 444 700444

c D RESULT
701 000 701000
701 001 701001
701 002 701002
.
.
.
701 444 701444

I have two problems that I need some some help with.

1. I'm having a problem in combining the numbers..when I try
to combine them using a expression ([A]+[b]) in a query, I get
the results of adding the two fields..not the combining them.

what you want to do is create a string that contains the two
numbers. Use the concatenation operator, (&) instead of the
summation operator (+). The problem is that leading zeroes
sometimes get messed up, so 700 000 mifht become 7000 and 701 001
shows as 7011. There's a fix for that too. It's the format
function, so the expression in your query winds up being
Format([A],"000") & format([b],"000")

2. Once I can get the two fields combined, I'm going to have
to sort the whole thing as follows

700000
701000
700001
701001
700002
701002
.
.
.
700444
701444
in the query grid, put a duplicate set of the fields you want to
sort on, in the order to sort by starting from left to right, in
your case b then a. uncheck the show: checkbox and choose
ascending in the sort: field

I'm a beginner at using access...I realize it's potential, but
little things like this really trip me up.

Feel free to emai me with suggestions
Bad thing to ask. Responses should go to the newsgroup so that
everyone can participate, and learn.

Thanks,
Mark


--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3
Thanks for your help; I'm going to try your fixes ASAP and post my
results to the group.

Mark
Bob Quintal <rq******@sPAmp atico.ca> wrote in message news:<Xn******* *************** @66.150.105.50> ...
ms********@hotm ail.com (M.Stanley) wrote in
news:79******** *************** **@posting.goog le.com:
Hi,
I'm attempting to create a query that will combine 2 columns
of numbers into one. The followng comes from 1 table with 4
fields (A,B,C,D)

A B RESULT
700 000 700000
700 001 700001
700 002 700002
.
.
.
700 444 700444

c D RESULT
701 000 701000
701 001 701001
701 002 701002
.
.
.
701 444 701444

I have two problems that I need some some help with.

1. I'm having a problem in combining the numbers..when I try
to combine them using a expression ([A]+[b]) in a query, I get
the results of adding the two fields..not the combining them.


what you want to do is create a string that contains the two
numbers. Use the concatenation operator, (&) instead of the
summation operator (+). The problem is that leading zeroes
sometimes get messed up, so 700 000 mifht become 7000 and 701 001
shows as 7011. There's a fix for that too. It's the format
function, so the expression in your query winds up being
Format([A],"000") & format([b],"000")

2. Once I can get the two fields combined, I'm going to have
to sort the whole thing as follows

700000
701000
700001
701001
700002
701002
.
.
.
700444
701444


in the query grid, put a duplicate set of the fields you want to
sort on, in the order to sort by starting from left to right, in
your case b then a. uncheck the show: checkbox and choose
ascending in the sort: field

I'm a beginner at using access...I realize it's potential, but
little things like this really trip me up.

Feel free to emai me with suggestions


Bad thing to ask. Responses should go to the newsgroup so that
everyone can participate, and learn.

Thanks,
Mark

Nov 13 '05 #4
Hi,
I was able to get the first part to work, by using the '&' operator
instead of the '+'..but I'm a little lost on how I'm going to change
the sort. At this point I have two columns of joined fields a&c and
c&d. Any clarfication is appreciated.

Thanks,
Mark

ms********@hotm ail.com (M.Stanley) wrote in message news:<79******* *************** ****@posting.go ogle.com>...
Thanks for your help; I'm going to try your fixes ASAP and post my
results to the group.

Mark
Bob Quintal <rq******@sPAmp atico.ca> wrote in message news:<Xn******* *************** @66.150.105.50> ...
ms********@hotm ail.com (M.Stanley) wrote in
news:79******** *************** **@posting.goog le.com:
Hi,
I'm attempting to create a query that will combine 2 columns
of numbers into one. The followng comes from 1 table with 4
fields (A,B,C,D)

A B RESULT
700 000 700000
700 001 700001
700 002 700002
.
.
.
700 444 700444

c D RESULT
701 000 701000
701 001 701001
701 002 701002
.
.
.
701 444 701444

I have two problems that I need some some help with.

1. I'm having a problem in combining the numbers..when I try
to combine them using a expression ([A]+[b]) in a query, I get
the results of adding the two fields..not the combining them.


what you want to do is create a string that contains the two
numbers. Use the concatenation operator, (&) instead of the
summation operator (+). The problem is that leading zeroes
sometimes get messed up, so 700 000 mifht become 7000 and 701 001
shows as 7011. There's a fix for that too. It's the format
function, so the expression in your query winds up being
Format([A],"000") & format([b],"000")

2. Once I can get the two fields combined, I'm going to have
to sort the whole thing as follows

700000
701000
700001
701001
700002
701002
.
.
.
700444
701444


in the query grid, put a duplicate set of the fields you want to
sort on, in the order to sort by starting from left to right, in
your case b then a. uncheck the show: checkbox and choose
ascending in the sort: field

I'm a beginner at using access...I realize it's potential, but
little things like this really trip me up.

Feel free to emai me with suggestions


Bad thing to ask. Responses should go to the newsgroup so that
everyone can participate, and learn.

Thanks,
Mark

Nov 13 '05 #5
Please ignore my previous post...I got the sort to work...thank you
for all of your help.

Mark
ms********@hotm ail.com (M.Stanley) wrote in message news:<79******* *************** ****@posting.go ogle.com>...
Thanks for your help; I'm going to try your fixes ASAP and post my
results to the group.

Mark
Bob Quintal <rq******@sPAmp atico.ca> wrote in message news:<Xn******* *************** @66.150.105.50> ...
ms********@hotm ail.com (M.Stanley) wrote in
news:79******** *************** **@posting.goog le.com:
Hi,
I'm attempting to create a query that will combine 2 columns
of numbers into one. The followng comes from 1 table with 4
fields (A,B,C,D)

A B RESULT
700 000 700000
700 001 700001
700 002 700002
.
.
.
700 444 700444

c D RESULT
701 000 701000
701 001 701001
701 002 701002
.
.
.
701 444 701444

I have two problems that I need some some help with.

1. I'm having a problem in combining the numbers..when I try
to combine them using a expression ([A]+[b]) in a query, I get
the results of adding the two fields..not the combining them.


what you want to do is create a string that contains the two
numbers. Use the concatenation operator, (&) instead of the
summation operator (+). The problem is that leading zeroes
sometimes get messed up, so 700 000 mifht become 7000 and 701 001
shows as 7011. There's a fix for that too. It's the format
function, so the expression in your query winds up being
Format([A],"000") & format([b],"000")

2. Once I can get the two fields combined, I'm going to have
to sort the whole thing as follows

700000
701000
700001
701001
700002
701002
.
.
.
700444
701444


in the query grid, put a duplicate set of the fields you want to
sort on, in the order to sort by starting from left to right, in
your case b then a. uncheck the show: checkbox and choose
ascending in the sort: field

I'm a beginner at using access...I realize it's potential, but
little things like this really trip me up.

Feel free to emai me with suggestions


Bad thing to ask. Responses should go to the newsgroup so that
everyone can participate, and learn.

Thanks,
Mark

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4369
by: Paddy McCarthy | last post by:
Hi, I am trying to use eval as little as possible but solve this problem. #If given:two or more lambda equations x=lambda : A < B y=lambda : C+6 >= 7 .... How do I create another lambda expression Z equivalent to
8
8359
by: Ilan | last post by:
Hi all I need to add data from two Excel sheets (both on the same workbook) to an existing table in my SQL DB. The problem is that each sheet holds different fields for the same record, though the records are sorted by row numbers. (I had to split the fields to different sheets because Excel has a limit of 256 fields in each sheet) My sheets are quite large (~55,000 rows and 200 columns each) and I'll have to repeat this action many...
2
3275
by: Chris Mullins | last post by:
I've spent a bit of time over the last year trying to implement RFC 3454 (Preparation of Internationalized Strings, aka 'StringPrep'). This RFC is also a dependency for RFC 3491 (Internationalized Domain Names / IDNA) which is something that I also need to support. The problem that I've been struggling with in .NET is that of Unicode Code Points > 0xFFFF. These points are encoded into UTF8 using the Surrogate Pair encoding scheme that...
7
4817
by: Barry | last post by:
Hi all, I've noticed a strange error on my website. When I print a capital letter P with a dot above, using & #7766; it appears correctly, but when I use P& #0775 it doesn't. The following capital letters all work correctly - B C D F G M S T with the diacritical marker &#_0775. Why am I having a problem with P?
3
5642
by: craig.brenizer | last post by:
I have a table of data that has duplicate values in the pagenumber field. How can I combine the data so that the page numbers of duplicate part numbers are on one record for that part number? Here is what "table1" looks like now. Note that partnumbers 10-20 and 20-62 duplicate data, except for the pagenumbers, which are different. partnumber price pagenumber
0
996
by: Julio Sarmiento | last post by:
I have a table containing the following fields: rep numbers, year, month, qty, revenue, credit apps, new accounts. The data in this table reflects the rep's daily numbers. What I need to do is sum the columns and rank each column totals against all the records in the table. For example - assume that the figure below are the monthly totals for four reps. Rep Number Year Month Qty Revenue Credit Apps New Accounts...
1
3687
by: Roger | last post by:
I know this is probably an easy question. But in VB.Net when you instantiate a fontstyle object, the parameter for fontstyle, if you wanted it to be Bold and Italic, you would enter "FontStyle.Bold + FontStyle.Italics". But in C#, it does not like that syntax. What is the proper syntax in C#?
5
5639
by: Tristan Miller | last post by:
Greetings. Is it possible using HTML and CSS to represent a combining diacritical mark in a different style from the letter it modifies? For example, say I want to render Å‘ (Latin small letter o with a double acute accent), but with the o in black and the double acute accent in green. Are either of the following valid? 1. <span style="color: black;">o</span><span style="color: green;">&#x030B;</span>
4
1398
by: calphord | last post by:
I have written some code that will find the average then the middle number and then the most used number of a user entered list of numbers. I have the code as separate programs and they all work fine separately. But I am trying to put them together as one. I have the average working fine but I can not get the middle and most to print. Also after the numbers have been entered I want it to save the list that is entered in to a file then recall it...
0
9359
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9236
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
8235
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
6792
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
6072
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
4592
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...
1
3298
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
2774
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.