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
11 4460
As long it is as you say, it should simply be this: - INSERT INTO [Table 3] ([Part Number], [Data 1], [Data 2], [Data 3])
-
SELECT [Table 1].[Part Number]
-
, [Table 1].[Data]
-
, [Table 1].[Data 1]
-
, [Table 1].[Data 2]
-
, [Table 2].[Data 3]
-
FROM [Table 1], [Table 2]
-
WHERE [Table 1].[Part Number] = [Table 2].[Part Number]
-AJ
Would this be VBA? I looks like it might work. little lost.
@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
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.
@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
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
This is tens of thousands of lines of data.
It will be going to the FAA so must be absolutly accurate.
Mike
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: - INSERT INTO [Table 3] ([Part Number], [Data 1], [Data 2], [Data 3])
-
SELECT [Table 1].[Part Number]
-
, [Table 1].[Data]
-
, [Table 1].[Data 1]
-
, [Table 1].[Data 2]
-
, [Table 2].[Data 3]
-
FROM [Table 1], [Table 2]
-
WHERE [Table 1].[Part Number] = [Table 2].[Part Number]
-
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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
|
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
|
by: Rebecca |
last post by:
could someone tell me the correct syntax for using vlookup
in visual basic
|
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
| |
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...
|
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
|
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...
|
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.
|
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...
|
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...
| |
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |