PC Review


Reply
Thread Tools Rate Thread

Combining two number fields into one

 
 
DJ
Guest
Posts: n/a
 
      22nd Apr 2009
I've got a number field in a table with two digits ("08"). I've got another
number field in the same table with four digits ("1234"). Is there a way to
combine these into a six digit field ("081234")? And then - is there a way
to do a one-to-many match of this configured six-digit number to a six-digit
number from another table?
 
Reply With Quote
 
 
 
 
Wayne-I-M
Guest
Posts: n/a
 
      22nd Apr 2009
Hi

Simple answer No.

The 2 "numbers" you have are not numbers they are text (well the second may
be but the 1st isn't) numbers can't start with 0. So your 08 (if it was a
number would be just 8.

Would you can is to concentate the text fields then convert this to a number
(you can do this in the same function) but dont forget you will lose any
preceeding 0's.

Next bit - Yes you can simple do a drag and drop in the relationship window
to create the One-to-Many but to get a better answer on that you'd need to
give more details. But the basics are that as long as the field (in each
table) are the same number / text / etc) there should not be problem - but
(again) don't forget that your are dealing with a "text" field and not a
number if you have a precceding 0.




--
Wayne
Trentino, Italia.



"DJ" wrote:

> I've got a number field in a table with two digits ("08"). I've got another
> number field in the same table with four digits ("1234"). Is there a way to
> combine these into a six digit field ("081234")? And then - is there a way
> to do a one-to-many match of this configured six-digit number to a six-digit
> number from another table?

 
Reply With Quote
 
DJ
Guest
Posts: n/a
 
      22nd Apr 2009
Bad example. I do understand the preceeding zero thing. Let's say my first
number is "12". I can figure out how to do it in a query. But can I do this
"new" table within the original table itself? Or can you only do a
calculated field within a table if it's pulling data from a DIFFERENT table?

"Wayne-I-M" wrote:

> Hi
>
> Simple answer No.
>
> The 2 "numbers" you have are not numbers they are text (well the second may
> be but the 1st isn't) numbers can't start with 0. So your 08 (if it was a
> number would be just 8.
>
> Would you can is to concentate the text fields then convert this to a number
> (you can do this in the same function) but dont forget you will lose any
> preceeding 0's.
>
> Next bit - Yes you can simple do a drag and drop in the relationship window
> to create the One-to-Many but to get a better answer on that you'd need to
> give more details. But the basics are that as long as the field (in each
> table) are the same number / text / etc) there should not be problem - but
> (again) don't forget that your are dealing with a "text" field and not a
> number if you have a precceding 0.
>
>
>
>
> --
> Wayne
> Trentino, Italia.
>
>
>
> "DJ" wrote:
>
> > I've got a number field in a table with two digits ("08"). I've got another
> > number field in the same table with four digits ("1234"). Is there a way to
> > combine these into a six digit field ("081234")? And then - is there a way
> > to do a one-to-many match of this configured six-digit number to a six-digit
> > number from another table?

 
Reply With Quote
 
DJ
Guest
Posts: n/a
 
      22nd Apr 2009
Bad example. Let's say the first number is "12".

I can figure out how to combine the two numbers into one within a query.
But can I do it in a table? Or can you only do calculated fields in a table
if it's pulling the fields from a DIFFERENT table?

"Wayne-I-M" wrote:

> Hi
>
> Simple answer No.
>
> The 2 "numbers" you have are not numbers they are text (well the second may
> be but the 1st isn't) numbers can't start with 0. So your 08 (if it was a
> number would be just 8.
>
> Would you can is to concentate the text fields then convert this to a number
> (you can do this in the same function) but dont forget you will lose any
> preceeding 0's.
>
> Next bit - Yes you can simple do a drag and drop in the relationship window
> to create the One-to-Many but to get a better answer on that you'd need to
> give more details. But the basics are that as long as the field (in each
> table) are the same number / text / etc) there should not be problem - but
> (again) don't forget that your are dealing with a "text" field and not a
> number if you have a precceding 0.
>
>
>
>
> --
> Wayne
> Trentino, Italia.
>
>
>
> "DJ" wrote:
>
> > I've got a number field in a table with two digits ("08"). I've got another
> > number field in the same table with four digits ("1234"). Is there a way to
> > combine these into a six digit field ("081234")? And then - is there a way
> > to do a one-to-many match of this configured six-digit number to a six-digit
> > number from another table?

 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      22nd Apr 2009
A point of clarification, following on Wayne's response...

You are calling them "numbers". Is it possible that they are actually
identifiers or codes that happen to be digits? If that's the case, Wayne's
comment about text is your solution.

Stop thinking about them as "numbers" and start treating them as text.

Yes, you can concatenate two text fields in a query to get a new
(concatenated) field, then use that query to compare that new (text) field
to another table's text field.

.... or have I misinterpreted your description?

Regards

Jeff Boyce
Microsoft Office/Access MVP


"DJ" <(E-Mail Removed)> wrote in message
news:3D2ABC97-26B1-4015-8AA8-(E-Mail Removed)...
> I've got a number field in a table with two digits ("08"). I've got
> another
> number field in the same table with four digits ("1234"). Is there a way
> to
> combine these into a six digit field ("081234")? And then - is there a
> way
> to do a one-to-many match of this configured six-digit number to a
> six-digit
> number from another table?



 
Reply With Quote
 
Wayne-I-M
Guest
Posts: n/a
 
      22nd Apr 2009
Sorry - you lost me on that.

Have a look at Jeff's answer 1st and see if that is what you're looking for.

To answer this question (sorry about) agai the answer is No. You only
(should) use a table for storing data - as they say up "nowt" else.

Add a new field you some
Create a query
Concencate the 2 fields (whatever they)
Convert the query to an update
Update the new field you just made
Try doing you relationship thing with this
Does this work ??

If not then post back

--
Wayne
Trentino, Italia.



"DJ" wrote:

> Bad example. Let's say the first number is "12".
>
> I can figure out how to combine the two numbers into one within a query.
> But can I do it in a table? Or can you only do calculated fields in a table
> if it's pulling the fields from a DIFFERENT table?
>
> "Wayne-I-M" wrote:
>
> > Hi
> >
> > Simple answer No.
> >
> > The 2 "numbers" you have are not numbers they are text (well the second may
> > be but the 1st isn't) numbers can't start with 0. So your 08 (if it was a
> > number would be just 8.
> >
> > Would you can is to concentate the text fields then convert this to a number
> > (you can do this in the same function) but dont forget you will lose any
> > preceeding 0's.
> >
> > Next bit - Yes you can simple do a drag and drop in the relationship window
> > to create the One-to-Many but to get a better answer on that you'd need to
> > give more details. But the basics are that as long as the field (in each
> > table) are the same number / text / etc) there should not be problem - but
> > (again) don't forget that your are dealing with a "text" field and not a
> > number if you have a precceding 0.
> >
> >
> >
> >
> > --
> > Wayne
> > Trentino, Italia.
> >
> >
> >
> > "DJ" wrote:
> >
> > > I've got a number field in a table with two digits ("08"). I've got another
> > > number field in the same table with four digits ("1234"). Is there a way to
> > > combine these into a six digit field ("081234")? And then - is there a way
> > > to do a one-to-many match of this configured six-digit number to a six-digit
> > > number from another table?

 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      22nd Apr 2009
You can't calculate a field directly in a table, if that is what you are
asking. However, I expect you could calculate the field in a query, then
join the query to another query or to a table by way of that field.

"DJ" <(E-Mail Removed)> wrote in message
news:F9BA27EF-4868-4AE8-8137-(E-Mail Removed)...
> Bad example. I do understand the preceeding zero thing. Let's say my
> first
> number is "12". I can figure out how to do it in a query. But can I do
> this
> "new" table within the original table itself? Or can you only do a
> calculated field within a table if it's pulling data from a DIFFERENT
> table?
>
> "Wayne-I-M" wrote:
>
>> Hi
>>
>> Simple answer No.
>>
>> The 2 "numbers" you have are not numbers they are text (well the second
>> may
>> be but the 1st isn't) numbers can't start with 0. So your 08 (if it was
>> a
>> number would be just 8.
>>
>> Would you can is to concentate the text fields then convert this to a
>> number
>> (you can do this in the same function) but dont forget you will lose any
>> preceeding 0's.
>>
>> Next bit - Yes you can simple do a drag and drop in the relationship
>> window
>> to create the One-to-Many but to get a better answer on that you'd need
>> to
>> give more details. But the basics are that as long as the field (in each
>> table) are the same number / text / etc) there should not be problem -
>> but
>> (again) don't forget that your are dealing with a "text" field and not a
>> number if you have a precceding 0.
>>
>>
>>
>>
>> --
>> Wayne
>> Trentino, Italia.
>>
>>
>>
>> "DJ" wrote:
>>
>> > I've got a number field in a table with two digits ("08"). I've got
>> > another
>> > number field in the same table with four digits ("1234"). Is there a
>> > way to
>> > combine these into a six digit field ("081234")? And then - is there a
>> > way
>> > to do a one-to-many match of this configured six-digit number to a
>> > six-digit
>> > number from another table?



 
Reply With Quote
 
DJ
Guest
Posts: n/a
 
      22nd Apr 2009
I combined the two with a calculated field on the form. Thanks.

"Wayne-I-M" wrote:

> Sorry - you lost me on that.
>
> Have a look at Jeff's answer 1st and see if that is what you're looking for.
>
> To answer this question (sorry about) agai the answer is No. You only
> (should) use a table for storing data - as they say up "nowt" else.
>
> Add a new field you some
> Create a query
> Concencate the 2 fields (whatever they)
> Convert the query to an update
> Update the new field you just made
> Try doing you relationship thing with this
> Does this work ??
>
> If not then post back
>
> --
> Wayne
> Trentino, Italia.
>
>
>
> "DJ" wrote:
>
> > Bad example. Let's say the first number is "12".
> >
> > I can figure out how to combine the two numbers into one within a query.
> > But can I do it in a table? Or can you only do calculated fields in a table
> > if it's pulling the fields from a DIFFERENT table?
> >
> > "Wayne-I-M" wrote:
> >
> > > Hi
> > >
> > > Simple answer No.
> > >
> > > The 2 "numbers" you have are not numbers they are text (well the second may
> > > be but the 1st isn't) numbers can't start with 0. So your 08 (if it was a
> > > number would be just 8.
> > >
> > > Would you can is to concentate the text fields then convert this to a number
> > > (you can do this in the same function) but dont forget you will lose any
> > > preceeding 0's.
> > >
> > > Next bit - Yes you can simple do a drag and drop in the relationship window
> > > to create the One-to-Many but to get a better answer on that you'd need to
> > > give more details. But the basics are that as long as the field (in each
> > > table) are the same number / text / etc) there should not be problem - but
> > > (again) don't forget that your are dealing with a "text" field and not a
> > > number if you have a precceding 0.
> > >
> > >
> > >
> > >
> > > --
> > > Wayne
> > > Trentino, Italia.
> > >
> > >
> > >
> > > "DJ" wrote:
> > >
> > > > I've got a number field in a table with two digits ("08"). I've got another
> > > > number field in the same table with four digits ("1234"). Is there a way to
> > > > combine these into a six digit field ("081234")? And then - is there a way
> > > > to do a one-to-many match of this configured six-digit number to a six-digit
> > > > number from another table?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
issue number 2 with combining control fields =?Utf-8?B?UGF0cmljaw==?= Microsoft Access Form Coding 2 17th Aug 2007 02:06 AM
Combining Fields in a Query into Two Fields =?Utf-8?B?TWFydGlu?= Microsoft Access Queries 3 16th Feb 2007 11:31 PM
Combining variable number of fields =?Utf-8?B?TWFyayBPbHNlbg==?= Microsoft Access Queries 1 25th Jan 2006 06:52 PM
syntax for combining text fields and formatted date fields; =?Utf-8?B?ZGlyb3M=?= Microsoft Access Queries 1 5th Oct 2005 01:15 PM
Combining two fields Jacqui Microsoft Access ADP SQL Server 3 16th Aug 2004 05:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 PM.