Copy one field in two or more fields

Hi
i have a tableA with one field and another tableB with two fields.

TableA
Name
 a
 b
 c
 d
 e
 f
..
...

I want copy all values alternatively, in an another tableB with two fields.
The results should be:
TableB
NameA   NameB
 a               b
 c               d
 e               e
..

Anyone can be help me ?
Thank you in advance
Best regards
Diego

-- 
Message posted via http://www.accessmonster.com

0
Diego
12/3/2009 11:05:47 AM
access.formscoding 7493 articles. 0 followers. Follow

7 Replies
509 Views

Similar Articles

[PageSpeed] 45

Diego via AccessMonster.com wrote:
>i have a tableA with one field and another tableB with two fields.
>
>TableA
>Name
> a
> b
> c
> d
> e
> f
>..
>
>I want copy all values alternatively, in an another tableB with two fields.
>The results should be:
>TableB
>NameA   NameB
> a               b
> c               d
> e               e
>.
>
>Anyone can be help me ?


No can do unless you can explain the *very* precise rules
that determine which record in table A goes to which record
and field in table B.  Since the records in a table can be
presented in any order, you *must* have some information in
table A that can be used to determine that name a and name b
go together and which one comes first.  The standard way is
to have sufficient data in other fields than can be used to
specify a unique sort that presents the records in the order
in your example.

-- 
Marsh
MVP [MS Access]
0
Marshall
12/3/2009 3:32:20 PM
In this case the rule is that even adn odd records are copied in a table
and/or other.

ID  Name
1     a
2     b
3     c
4     d
...

copied into two fields

Even  odd
 a       b
 c       d

Regards


Marshall Barton wrote:
>>i have a tableA with one field and another tableB with two fields.
>>
>[quoted text clipped - 18 lines]
>>
>>Anyone can be help me ?
>
>No can do unless you can explain the *very* precise rules
>that determine which record in table A goes to which record
>and field in table B.  Since the records in a table can be
>presented in any order, you *must* have some information in
>table A that can be used to determine that name a and name b
>go together and which one comes first.  The standard way is
>to have sufficient data in other fields than can be used to
>specify a unique sort that presents the records in the order
>in your example.
>

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
Diego
12/3/2009 6:06:35 PM
Diego via AccessMonster.com wrote:
> Hi
> i have a tableA with one field and another tableB with two fields.
>
> TableA
> Name
> a
> b
> c
> d
> e
> f
> .
> ..
>
> I want copy all values alternatively, in an another tableB with two
> fields. The results should be:
> TableB
> NameA   NameB
> a               b
> c               d
> e               e
> .
>
What Marshall said is true.
If  it is always a first name, last name situition, this might be OK.
If all the values are the same kind of name then it would be a bad idea. 


0
Mike
12/3/2009 6:24:16 PM
You must be able to **absolutely guarantee** that every
record's ID field strictly adheres to that rule.  (Note: an
AutoNumber field can not provide that guarantee.)

If so, you can use a query that joins the table to itself to
get the correct two names together in the same record.

SELECT TableA.[Name] As FN, TableA1.[Name] As LN
FROM TableA INNER JOIN TableA As TableA1
	ON TableA.ID = TableA1.ID + 1

Note:  This kind of query must be done in SQL view because
the query designer is not able to deal with non-equal joins.

That query can be used as the basis for a MakeTable  or
Append query to populate tableB.
-- 
Marsh
MVP [MS Access]


Diego via AccessMonster.com wrote:
>In this case the rule is that even adn odd records are copied in a table
>and/or other.
>
>ID  Name
>1     a
>2     b
>3     c
>4     d
>..
>
>copied into two fields
>
>Even  odd
> a       b
> c       d
>
>Marshall Barton wrote:
>>>i have a tableA with one field and another tableB with two fields.
>>>
>>>Anyone can be help me ?
>>
>>No can do unless you can explain the *very* precise rules
>>that determine which record in table A goes to which record
>>and field in table B.  Since the records in a table can be
>>presented in any order, you *must* have some information in
>>table A that can be used to determine that name a and name b
>>go together and which one comes first.  The standard way is
>>to have sufficient data in other fields than can be used to
>>specify a unique sort that presents the records in the order
>>in your example.
0
Marshall
12/3/2009 8:01:38 PM
Hi
the result is a little different. Starting from a Table A
ID	Name
1	a
2	b
3	c
4	d
5	e
6	f

the query gives this result

FN	LN
b	a
c	b
d	c
e	d
f	e

It should be 
FN	LN
a      b
c	d
e	f

sorry but i am confusing
Let me know
Diego


Marshall Barton wrote:
>You must be able to **absolutely guarantee** that every
>record's ID field strictly adheres to that rule.  (Note: an
>AutoNumber field can not provide that guarantee.)
>
>If so, you can use a query that joins the table to itself to
>get the correct two names together in the same record.
>
>SELECT TableA.[Name] As FN, TableA1.[Name] As LN
>FROM TableA INNER JOIN TableA As TableA1
>	ON TableA.ID = TableA1.ID + 1
>
>Note:  This kind of query must be done in SQL view because
>the query designer is not able to deal with non-equal joins.
>
>That query can be used as the basis for a MakeTable  or
>Append query to populate tableB.
>>In this case the rule is that even adn odd records are copied in a table
>>and/or other.
>[quoted text clipped - 25 lines]
>>>specify a unique sort that presents the records in the order
>>>in your example.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
Diego
12/4/2009 11:19:11 AM
Diego via AccessMonster.com wrote:
>the result is a little different. Starting from a Table A
>ID	Name
>1	a
>2	b
>3	c
>4	d
>5	e
>6	f
>
>the query gives this result
>
>FN	LN
>b	a
>c	b
>d	c
>e	d
>f	e
>
>It should be 
>FN	LN
>a      b
>c	d
>e	f
>

I knew dat :-|

Sorry, let's try this:

SELECT TableA.[Name] As FN, TableA1.[Name] As LN
FROM TableA INNER JOIN TableA As TableA1
	ON TableA.ID = TableA1.ID - 1
WHERE (TableA.ID Mod 2) = 1


-- 
Marsh
MVP [MS Access]
0
Marshall
12/4/2009 4:02:04 PM
Great !
It is works.
Thank you very much
Diego

Marshall Barton wrote:
>>the result is a little different. Starting from a Table A
>>ID	Name
>[quoted text clipped - 19 lines]
>>c	d
>>e	f
>
>I knew dat :-|
>
>Sorry, let's try this:
>
>SELECT TableA.[Name] As FN, TableA1.[Name] As LN
>FROM TableA INNER JOIN TableA As TableA1
>	ON TableA.ID = TableA1.ID - 1
>WHERE (TableA.ID Mod 2) = 1
>

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
Diego
12/4/2009 4:13:17 PM
Reply:

Similar Artilces:

How do I increase query field length (>20 characters) ?
I want to exclude 3 or 4 variables from a particular query. Using Not "xx"or"yy" is fine, but when excluding more than this, query fails. I think the problem is that the total text characters is quite large (approx 60 characters in total, from four exclusions). Ideas, please ? 60 characters is not the limit. 1024 characters is the limit. POST the SQL of the query that is not working (View: SQL on the menu) or at a minimum post what you are attempting as the criteria. Also "query fails" does not tell us if you get an error (what is it) or the wrong resul...

How does one view a document created in Publisher.
I have gotten a document (calendar) in .pub format. Word does not recognize it. Is there a viewer? What's the link? I have Office 2000 with the converters installed. Collins wrote: >I have gotten a document (calendar) in .pub format. Word > does not recognize it. Is there a viewer? What's the > link? I have Office 2000 with the converters installed. ==================================== There is no viewer for Publisher files. Maybe you could ask the sender to convert it to a .pdf file. Or you could order the Trial version of Pub2003... which will still function as a viewer a...

One domain on exchange server not accepting connections
I setup a second domain on an Exchange 2003 server, and thought everything was working. Now, though, mail going to the second domain gets rejected, but mail going to the original domain is still working. I can telnet to the original domain, but not to the second domain. I've checked everything I know to check (I've setup plenty of domains on Exchange servers, so I believe I've gotten the setting correct), but I just can't get it to work. The MX records are correct, and mail.theseconddomain.com resolves to the right IP address (the same IP as mail.originaldomain.com), so it sh...

Lookup two columns
I want to compare the contents of two (adjacent) cells in one sheet with two adjacent cells in another sheet (within one workspace) and if the *pair* of cells are the same, deliver the value in the cell a few columns along (if you know what I mean - like lookup but comparing two cells). The cells are not sorted. Any ideas? Cheers. Bobby If you are comparing A1-B1 sheet 1 to A1-B1 sheet 2, then =IF(AND(Sheet1!A1=Sheet2!A1,Sheet1!B1=Sheet2!B1),"They match","no match") If you have to "lookup" A1-B1 against the whole columns of A and B on sheet2, then kyou co...

Sum a column that meets two criteria
I need to sum a column of numbers if it matches two different criteria. I can set up the SUMIF easily for meeting one criteria, but I need to also sum the column if it meets that criteria, and another. For example: A B C 1 150 ABC MS1 2 200 DEF MS0 3 100 LMN MS0 4 125 ABC MS1 5 175 LMN MS1 6 225 DEF MS0 I need to have a formula that would say <<Sum column A IF column B = "DEF" AND column C = "MS0">>. (and so forth for the other combinations). I know there has to be a way to do this, probably using a combination of an IF and SUMIF functions - but i keep...

Get $500 to your PAYPAL Account by just one CLICK)
i have hidden the form of getting $500 to your PAYPAL ACCOUNT....CLICK on the IMAGE which is on the RIGHT SIDE of the website http://tricks-4u.4-all.org/ ...

Changing a text field to a date field
Hi I know this is a problem for lots of people but I still cant find an answer. I have imported a text file into excel with a number field that displays credit card expiry dates as a 4 digit number. example 0408 so month + year. I have converted the number field to a text field so it doesnt drop off the first zero and now I need to convert it to a date field. Any nice easy simple ideas. Any help would be much appreaciated. Or direction to a question the same. Perhaps =DATE(100+RIGHT(A1,2),LEFT(A1,2),1) format as date -- daddylonglegs --------------------------------------------...

my brain not comprehending the yes/no field
I have a db that enters orders. The "product" (insurance plan) has one price but 20 different "attributes" in any combo of one choice to many (plan types like medical, dental etc...) and with one "price" (premium). The plan types must show up on one line in a report with one price (they are not deliminated per plan type). The easiest way for personnel to enter all the plan types would be yes/no check boxes on the input form. My problem is I can't figure out how to make those "yes"es equal the plan name in the report! I know, it's proba...

Calculate the % increase for two columns
I have a pivot table, the data was first display by date, i know i can use the grouping function to group data into monthly basis. But I want to know that can I set the formula to calculate the months difference between, say the sales amount of June & July, and the % of the difference?? Million thanks If you have a grouped field, you won't be able to add a calculated item to the pivot table. In the source data, you could add a column to calculate the month for each record. Refresh the pivot table, and add the new field Add another copy of the Data field to the data area Right-c...

Excel formula copied down
Is there a way to copy down a column this formula =F3*A2 and have the A2 stay the same all the way down? The F3 would change on each row, F4, F5 etc. but the A2 would stay 'constant'. Thanks in advance for any help! =F3*A$2 -- Ian -- "Pat" <Pat@discussions.microsoft.com> wrote in message news:73505B29-538A-48C7-8F2F-F6126EF2126B@microsoft.com... > Is there a way to copy down a column this formula =F3*A2 and have the A2 > stay > the same all the way down? The F3 would change on each row, F4, F5 etc. > but > the A2 would stay 'constant'...

I can copy but won't paste
I was able to copy and paste then not sure why but it would only paste the same txt over and over, not allowing new txt copied to be paste. Now I cant paste at all. It will copy but when I click paste it does nothing, help! This could be a poorly designed add-in interfering with copy and paste operations. Did you install something recently? -- Stefan Blom Microsoft Word MVP "Sarlou" <Sarlou@discussions.microsoft.com> wrote in message news:0E5E33F7-2387-4DBC-809E-AA97F930CEF5@microsoft.com... >I was able to copy and paste then not sure why but it would o...

Copying values from place to place
Hello community: Is it possible say, to type a value in a textbox in one form (Form A), automatically copy that value, then open another form( Form B) and automatically paste that value into another textbox in Form B? Is this possible? Thank you for your help. -Gabriel M. If you open Form B from Form A you can use the OpenArgs of the OpenForm command line to pass a value to Form B. docmd.OpenForm "FormName",,,,,,Me.TextBoxName On the OnLoad event of the Form B you can use set the value in the text box If not IsNull(Me.OpenArgs) Then Me.TextBox = Me.OpenArgs End If -- ...

simple? pasting simple formula, error on copy
I have some store buying spreadsheets I made up. Very very basic, one of the columns has a total at the bottom or end as you may call it for total $ amount bought. that final number is in c33. c1, c2, c3 etc is a amount from each vendor. I want to have a column telling me the percentage being spent on each, simple enough so I make a column with the following formula =c33/c5. I get a number, change it to percentage and BAM I have exactly what I want. I pasted that formula and pasted it into all the other rows of that certain column, but I keep getting the #div/0 error, cause the new formulas...

Forms in two differant views
Is there a way to use the same sub form showing two differant views within the same Main Form. For example: Can I show on one tab a datasheet view and on the other a regular form view. -- Rose Hi Rose, Create a button on your form and under the "OnClick" event put 'Me.DefaultView = Datasheet Alternatively you could use a checkbox If me.checkbox1 = 0 then Me.DefaultView = 2 ' Datasheet Else Me.DefaultView = 0 'Single Form End if me.repaint This should flick the form between datasheet and form views. HTH, Nick. "Rose" wrote: > Is there a way to use t...

Run two copies of Outlook with different profiles
Hello! I'm trying to run two copies of Outlook with different (outlook)profiles at the same time. Normally i can choose the profile with the /profile switch, but if there is already a copy of outlook running, this switch seems to be ignored. Any ideas how to handle this are welcome. Regards, Reinhard "Reinhard" <reinhard.spieker@bkvibro.de> wrote in message news:60a7e218.0311190408.6523100b@posting.google.com... > Hello! > > I'm trying to run two copies of Outlook with different > (outlook)profiles at the same time. > > Normally i can choose the p...

Bar Chart (2D) won't let me 'gap' one bar behind the other?
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I have a nice, functioning bar chart that has 2 data fields: ACTUAL and BUDGET. <br><br>Actual is on one axis and Budget is on the 2nd axis. <br><br>These charts look nice side by side but I want one bar to be partly behind the other. <br><br>So, I select a data set. <br> Choose Format Data Series <br> Options <br> Overlap... (and no matter what value I choose, I can't overlap)???? <br><br>But, if I can adjust the Gap Width. <br><...

PrintPreview
Hello, I developed a VC++/MFC SDI application. The program supports PrintPreview. However, I only want the user to go forward ("Next Page") and not backward ("Prev Page"). How do I hide the "Prev Page" and "Two Page" buttons? TIA, Jacques Hello All, I found a nice Print Preview replacement toolbar (with bitmap buttons) on codeguru. To hide the "Prev Page" and "Two Page" buttons, simply remove them from the CMyPreviewView::OnCreate(LPCREATESTRUCT lpCreateStruct) method. The article was written by Robin J. Leatherbarrow. Thank...

Print multiple copies per sheet
I have a pubisher file that is a card with a size of 5 x 6 and is 2 pages. Is it possible to print 2 copies of this file on a letter size page so that there will be 2 double sided copies on the letter size page. I need to laminate these cards so if I could get 2 per page I would just need to cut the page in half. I am using Publisher 2003. Thanks in advance for any help. Best regards, Dee Page setup, Business card, change copies per sheet, Side margin 1.25, top margin ..5, zero gaps, okay out, in the next screen change the measurements to width 6" height 5". The above will...

How to Clear the AutoDetect Cache for the To: field
HI, When sending a message in Outlook, one begins to type the destination address in the To: field. Generally speaking if one has sent email to this address in the past then Outlook will auto detect and provide a suggested list of reciepients (know what I'm talking about???). Anyway, I know this feature can be disabled so one is never provided with a list of possible receipients but does anyone know how to clear this cache???? Thanks Remove individual addresses from the autocompletion cache by highlighting the entry when presented in the suggested names list (use your arrow key ...

How to force the user to fill in values for yes/no fields ?
Hi ! I'm using MS Access 2003. I have a table with a number of yes/no fields. When a new record is started, I want the user to explicitly specify a value for each of these fields, e.g. by choosing one of two radio buttons associated with the field. Now, it was no problem for me to arrange an option group with two suitable radio buttons for each of these fields. The user can then choose explicitly between yes and no. However, all fields seem to have implicit values immediately after a new record has been started. Therefore, the new record can be stored in the db without the user making...

Copying specific data from Word to Excel
What I need to do is 1) Extract the monetary amount (always after the 2nd asterisk (*) after the letters BPR. 2) Extract the number (always after the 2nd asterisk (*) after the letters TRN. 3) Place the numbers in the same row on an Excel spreadsheet. 4) Repeat to the end of the document. Sample data BPR*I*925.79*C*ACH*CCP*01*xxxxxxxxxxxx*DA*xxxxxxxxxxxxxxx*xxxxxxxxxxxxxxx**01*xxxxxxxxxxxx*DA*xxxxxxxxxxxxxxx*20091126~TRN*1*999999999*xxxxxxxxxxxx The file I need to extract from is always text. Is this better done from a Word macro or an Excel macro. Or can it be done at al...

How do I link one database inside another?
I am wanting to be able to click on a button in one database and open another database. Thanks. Why? As in "why open a separate database?" Would it be sufficient to have the tables from both databases linked into a common front-end file? Regards Jeff Boyce Microsoft Office/Access MVP "julrankay" <julrankay@discussions.microsoft.com> wrote in message news:C6DEF9FE-C983-4503-BCD8-75FF0354A533@microsoft.com... > I am wanting to be able to click on a button in one database and open > another database. Thanks. > if you used Access Data Projects then...

lost two months of received emails
Help I lost about 2 months of received emails. They are not in my deleted folder. I already tried the pst restore utility. Thanks ...

Help with SQL- SupplierList cost into Item cost field
Hi, re-posted! See below. Hi, thanks for that- it worked perfectly. There is just one snag however and I didn't think of it until I was testing. Many of the suppliers use specific currencies so the information I need copied from the Supplier tab is actually the Local Cost. When I view the SupplierList table, Local Cost doesn't appear as a column. Is it just a calculation based on exchange rates for information or does it actually exist somewhere within the database? Your help once again would be much appreciated. T. "convoluted" wrote: > Hi Tara - backup your...

Outlook does not recognize one or more names
When trying to send mail with outlook this is what my response is, "oultlook does not recognize one or more names. I can send mail when using my verizon mail program but not with outlook. Any ideas? have you verified that both you imcomming and outgoing mail servers are set correctly? I believe that verizon has several outgoing servers. You may want to contact their technical support to get the correct configuration for your account. You also did not note if you are using a router or firewall program on your computer. This can also create additional issues with your configurat...