473,804 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vlookup vs access

6 New Member
Table 1
Part number, Data, Data1, Data2.....
(Part Numer in this table is duplicated multiple times)

Table 2
Part Number, Data 3......
(Part Number in this table is not duplicated)

I would like to create a new table

Table 3
Part Number, Data, Data1, Data2, Data3

I can do this in excel with a vlookup however would like to do this in access

Mike
Nov 24 '09 #1
11 4460
ajalwaysus
266 Recognized Expert Contributor
As long it is as you say, it should simply be this:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [Table 3] ([Part Number], [Data 1], [Data 2], [Data 3])
  2. SELECT [Table 1].[Part Number]
  3.             , [Table 1].[Data]
  4.             , [Table 1].[Data 1]
  5.             , [Table 1].[Data 2]
  6.             , [Table 2].[Data 3]
  7. FROM [Table 1], [Table 2]
  8. WHERE [Table 1].[Part Number] = [Table 2].[Part Number]
-AJ
Nov 24 '09 #2
memiles
6 New Member
Would this be VBA? I looks like it might work. little lost.
Nov 24 '09 #3
ajalwaysus
266 Recognized Expert Contributor
@memiles
This is just a query, you could store it as such, or you could put it in VBA, your choice. Maybe you should state how you wish to use this code, as well as if the data you have is stored in Access tables, and we can help you figure out the best place to put this query.

-AJ
Nov 24 '09 #4
memiles
6 New Member
Ok... Table 3 will be a new table based on tables 1 and 2, created from tables one and two. Tables one and two are access tables imported from excel workbooks.

When everything is done I want to send the excel workbook to who ever using db queries.

Does this make sense?

Mike

Mike. If you need I can send data so you can understand.
Nov 24 '09 #5
ajalwaysus
266 Recognized Expert Contributor
@memiles
Ok what does this mean, are you going to be the one who imports the data and then run the necessary code to get the Table3 data? Or are you going to be handing this off to someone else after you import this data. I don't think I have a problem understanding the data as you have put it, but you need to explain better the flow of what you intend on doing.

Also, if you have already created Table 1, Table 2, and Table 3, then you should just be able to run the query i provided you as is.

-AJ
Nov 24 '09 #6
ajalwaysus
266 Recognized Expert Contributor
I am getting off work, but if no one responds before I do, I will try and respond in the next hour or so. Sorry.

-AJ
Nov 24 '09 #7
memiles
6 New Member
This is tens of thousands of lines of data.
Nov 24 '09 #8
memiles
6 New Member
It will be going to the FAA so must be absolutly accurate.

Mike
Nov 24 '09 #9
topher23
234 Recognized Expert New Member
Okay, so you're trying to take two tables that have been imported from an Excel workbook, merge them,and do... what? Port it back to Excel? The SQL aj gave you:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [Table 3] ([Part Number], [Data 1], [Data 2], [Data 3]) 
  2. SELECT [Table 1].[Part Number] 
  3.             , [Table 1].[Data] 
  4.             , [Table 1].[Data 1] 
  5.             , [Table 1].[Data 2] 
  6.             , [Table 2].[Data 3] 
  7. FROM [Table 1], [Table 2] 
  8. WHERE [Table 1].[Part Number] = [Table 2].[Part Number] 
  9.  
will work if you paste it into SQL view in Query Designer and "Run" it to create the third table you were asking about. But exactly what do you plan to do with the third table? It may be completely unnecessary to go this route, depending on what you're trying to do.
Nov 25 '09 #10

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

Similar topics

2
38823
by: chudson007 | last post by:
I've got a data set on which I'm trying to perform the same as excel's vlookup formula using SQL, but do not know how. Can anyone help? If you picture me having two tables Table_A and Table_B and they look like this; Table_A Name Sport John Football John Rugby Steve Cycling
3
21239
by: Fred | last post by:
I am trying to come up with a way to lookup values in Access as easily as I can in Excel. My application is looking up scores. An example lookup table below explains what I'm after: TABLE1 Measure (pct) Number score Letter grade Disposition 1% 40 A Pass 6% 36 B
3
2465
by: Fred | last post by:
I have an application that involves calculating a score based on a number of defects. Simplified example of the scoring: No_Defects Score 1-3 A 4-15 B 16-25 C over 25 X In Excel this is easy using a vlookup with its bin system
2
494
by: Rebecca | last post by:
could someone tell me the correct syntax for using vlookup in visual basic
1
2602
by: Crash91 | last post by:
I am using this formula in my sheet =VLOOKUP(A10,table,2) A10 is a cell that has the function :Left(sheet1!"c10"), it contains the correct value needed for the lookup but its isnt working! Can anyone help out? Thanks in Advance
5
17641
by: catlover30 | last post by:
HI, I need help with excel VLOOKUP! I am at a new job and really trying to solve this without asking anyone at work, since they seem th expect me to know this. What I am trying to acheive is the same thing as a FULL OUTER JOIN if you are familiar with sql. I tried to do this is in access, but access does not support full joins. Anyhow: I have two email lists, one woth 2500 entries, one with 2600. They are located in same worksheet, one in...
4
19990
by: ritheshtitu1982 | last post by:
Hi, I would like to perform Vlookup in access. Eg. I have two Tables Code table Code --- No { ------- 0 } ------- 1
1
6798
by: scubasteve | last post by:
Looking up values from an Access table is simple. Simulating the 'Range Lookup' functionality from Excel's VLookup formula is a bit trickier. For those that aren't familiar with this, it allows you to look up the next smallest value to what you provided, and return any corresponding field from the table. Very useful for looking up things like currency exchange rates, tax rates, etc., where there might not be an entry for every day/income...
9
3640
by: Sinner | last post by:
Hi, I have a field name 'USER' in tableMAIN. How do I replace the user names with corresponding user names. I can do that in xl using vlookup but now I'm trying to find a way to do that in access. For a user mismatch, it should give NA Thx.
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10090
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
7635
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
6863
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
5531
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
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
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
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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.