473,729 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I convert column data into row data using microsoft access?

9 New Member
Can this conversion be done using Microsoft Access?
If so how? Could this be done using TRANSFORM and PIVOT SQL statements?
The Old Format columns are NO and URL
The New Format Columns are No, User1URL and User2URL
Old Format
NO URL
16 http:/16_User1.html
16 http:/16_User2.html
18 http:/18_User1.html
18 http:/18_User2.html

New Format
NO User1URL User2URL
16 http:/16_User1.html http:/16_User2.html
18 http:/18_User1.html http:/18_User2.html
Sep 16 '10 #1
7 11361
Delerna
1,134 Recognized Expert Top Contributor
Its called a crosstab query in access

Goto the queries tab and click new. You should see a crosstab query wizard option

Choose that and follow the prompts, you should find yours fairly simple and intuitive to create
Sep 17 '10 #2
Ken Jones
9 New Member
The crosstab wizard generates 4 columns of URL information, because each of the abbreviated 4 URL's are variables that has a common element being User1 or User2 buried within it. I was hoping to generate a column of URL information for User1 and a column of URL information for User2 which would be the specified column headings. The crossab wizard does not allow this.
Sep 17 '10 #3
Delerna
1,134 Recognized Expert Top Contributor
You need to make a query off your table
The query needs to extract the User1,user2 info from the url into a third field so that you get this.
Use cominations of the left() right() and or mid() functions to get it
Expand|Select|Wrap|Line Numbers
  1. NO   USR      URL
  2. 16   User1    http:/16_User1.html
  3. 16   User2    http:/16_User2.html
  4. 18   User1    http:/18_User1.html
  5. 18   User2    http:/18_User2.html
  6.  
Now you create the crosstab off that with
NO as the row headings
USR as the column headings
and URL for the values


I did it with a mockup of your data and it works with the output thus
Expand|Select|Wrap|Line Numbers
  1.     User1                 User2 
  2. 16  http:/16_User1.html   http:/16_User2.html 
  3. 18  http:/18_User1.html   http:/18_User2.html 
  4.  
Sep 19 '10 #4
Delerna
1,134 Recognized Expert Top Contributor
Here is the query I did for the mockup of your data
Expand|Select|Wrap|Line Numbers
  1. SELECT [NO], Left(Right([url],10),5) AS Usr,[url]
  2. FROM TheTable
  3.  
  4.  
If the character length of the userID in the url is variable then you could use the InStr() fuction and find the positions of the _ and the . and then get the characters between them.
Sep 20 '10 #5
Ken Jones
9 New Member
Thanks for your prompt reply. I didn't phrase my question very well! I also have a term labeled AreaSupport that I did not include in my original problem that does not work with your response. If you could give me the query to delimit the value with the underscore preceding and the period following , I would really appreciate it!
Sep 20 '10 #6
Delerna
1,134 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. SELECT NO, 
  4.    Mid([url],InStr([url],"_")+1,InStr([url],".")-InStr([url],"_")-1) AS USR, 
  5.    [url]
  6. FROM TheTable
  7.  
  8.  
Sep 20 '10 #7
Ken Jones
9 New Member
You have solved all my problems for me! (At least my programming problems)
Sep 21 '10 #8

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

Similar topics

3
13031
by: Victoria Holowchak | last post by:
I was hoping that Microsoft Access 2002 would allow users to see all the columns of an Oracle database table that contained more than 255 columns. I noticed that my Oracle8 ODBC driver is only at 8.1.6.0.0 for win95, win98 and winNT. If I upgraded my ODBC driver would Access be able to recognize the columns beyond the 255th column? or is this an Access limitation? Please don't lecture me about good table design and recommend splitting...
0
1354
by: Michael SL | last post by:
I am trying to get the Table Column definitions from a Microsoft Access 2000 database (*.mdb). Using VB with System.Windows.Forms.Form I do the following Dim OpenDBDialog As New OpenFileDialo OpenDBDialog.Filter = "Database files (*.mdb)|*.mdb OpenDBDialog.RestoreDirectory = Tru If OpenDBDialog.ShowDialog() = DialogResult.OK The Dim ColumnName As Strin Dim ii As Intege Dim jj As Intege Dim oConn As OleDbConnectio
5
5806
by: Hannie | last post by:
I am currently doing my project using VB.NET I have a database which contains all my data that the user key in. The problem is, when i click the retrieve button on the form, the details that the user keyed in cant be retrieve. The connection is made, just that the data cant be retrive. Hope someone can help mi... Thanks. its urgent... =]
1
1949
by: dhussong | last post by:
I am attempting to use Visual Studio 2005 (Visual Basic) and the Enterprise Library 2.0 Data Access Application Block with a Microsoft Access database. I know the names of my Access databases but I don't know their location until the user has started using the application. Therefore I cannot hardcode the location into the app.config file as the Data Access Application Block seems to need. So I have 2 questions: 1. Is it possible to use a...
1
1464
by: glenn | last post by:
Hi folks, Have read a bit on this topic but so far no positive results. I have the following table named 'discussions': id discussionNumber from to status 1 1 xxx xxx done 2 1 xxx xxx done 3 2 xxx xxx done
23
7123
by: Steven TK | last post by:
Hi everyone, I wonder who can help me on the filter the Start Date and End Date. I still cannot manage to filter it. Eg. When the user click the StartDate(comboBox as 16/7/07), the Start Date(textbox should show only 16/7/07) and this also apply to the EndDate. Private Sub cboStartDate_Click() 'Purpose: Build up the criteria string form the non-blank search boxes, and apply to the form's Filter. 'Notes: 1. We tack " AND " on the end...
1
3912
by: mcVBNet10 | last post by:
I am working on a project in VB.Net using access as backend. But I wanted to take advantage of access reporting power. Therefore I was trying to see if I could open an Access Report (Built inside of access) from within VB.Net using the command Docmd.OpenReport. All of my attempts have given no results yet. I neet some help. I don't know if it is possible. Thanks
1
3655
by: BharathP | last post by:
Hi, I need to transfer data of one of the table in DB2 to Microsoft Access. I tried using DBOP data source using Configuration assistant in DB2 and SQL passthrough in Microsoft Access. I think I'm doing some mistake in the configuration. Can anybody pls tell me the exact steps to configure it. Or is ther any other process to accomplish this task? Thanks in advance, Bharath
1
1656
by: BharathP | last post by:
Hi, I need to transfer data of one of the table in DB2 to Microsoft Access. I tried using DBOP data source using Configuration assistant in DB2 and SQL passthrough in Microsoft Access. I think I'm doing some mistake in the configuration. Can anybody pls tell me the exact steps to configure it. Or is ther any other process to accomplish this task? Thanks in advance, Bharath
1
2562
by: ncsthbell | last post by:
I created a database using full blown access 2007. I have put it out for users to grab and test using Runtime Access 2007. They have entered data and now I need to go back into a table and change a setting for a different test. I am opening the same database using full blown MS 2007 and when I do, it appears I have no tables or queries. I have gone to the navigation pane, navigation options and set the property to show hidden objects but the...
0
8763
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9427
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
9148
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...
1
6722
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
6022
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
4528
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
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.