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

Alternate data from two different columns into rows

37
I was wondering if there was a way to alternate data taken from two different columns in a query, then placing that data into a another query or table. For example, let's say I have the following query, with the respective columns:

column1.......column2
A....................1
B....................2
C....................3
D....................4

Then I would like to input the above information into another query/table like so:

A
1
B
2
C
3
D
4

Is there any way to successfully do this?
Sep 19 '10 #1
1 1439
yarbrough40
320 100+
You could create two recordsets: one against the original table/query and one against your target table/query. What you would do then is read through Recordset1 and update Recordset2 as you go. Something like:
Expand|Select|Wrap|Line Numbers
  1. rs2.fields(0) = rs1.fields(0).value
  2. rs2.MooveNext()
  3. rs2.fields(0) = rs1.fields(1).value
  4. rs2.MooveNext()
  5. Loop 
Sep 20 '10 #2

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

Similar topics

1
by: ravi | last post by:
I have created the following interest to calculate the interest for the following currency pairs. I have tried to combine them in macros using conditions but the next query that is run in the macro...
5
by: Daniel Tan | last post by:
Are there anyway to copy rows of records from one query to another query and then hide the records in source query ? Pls advise. Thanks. Regards, Daniel
2
by: Kenneth | last post by:
How can I calculate number of rows in different queries? I have one query for each day, and there is 365 days. Each query have a different number of rows: 1st of January have 30 rows, 2nd of...
1
by: Stuart Shay | last post by:
Hello All: I am working on a ASP.NET GridView, I am not sure to correctly define the condition so Alternating Rows are fired with in the event. My Code only works on Item Rows in both Normal and...
1
by: Aaron West | last post by:
Try this script to see what queries are taking over a second. To get some real output, you need a long-running query. Here's one (estimated to take over an hour): PRINT GETDATE() select...
10
by: john | last post by:
I have a report to print envelopes. The report is based on a query. Now I need to make 10 more queries to make different selections of addresses. Every query has the same output fields as the...
1
by: Sachin | last post by:
Hi All, I am using ASP.NET Repeater Web Control. I want to use different stylesheets for alternating rows similar to DataGrid contorl. How can I do this? Thanks In Advance Sachin
3
by: robin1983 | last post by:
HI all, how are you ? i need help from you people. This time my problem is that i m running a query inside another query. But, the result that i got is something not exactly what i want. and one...
0
by: Liz the Whizz | last post by:
I want to write some code that will list the source tables and queries for each query in a database. At present, it is listing the original source tables, rather than the query(s) that subsequent...
14
by: Supermansteel | last post by:
My team at work uses Cognos to run multiple queries to pull in data. Then they take that data and import into Access and then usually run an Append Query to run a RND function to pull out a few...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.