473,462 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How move data into a temp table from two tables using the innerjoin

Hi there,

I have a tricky one.....(For me that is.)

I am trying to move data into a temp table, but the date comes from 2 tables using the innerjoin method.

Here is the code I have so far:

INSERT INTO TempTable (SELECT Distinct PlakkerData.Lidno, PlakkerData.DepName, LedeData.POBOX, LedeData.STREET, LedeData.CITY, LedeData.ZIP, CAST(PlakkerData.KorrCode AS varchar(2)) AS KorrCode, PlakkerData.KorrDate, CAST(LedeData.AANTAFH AS VARCHAR(2)) AS AANTAFH, LedeData.LIDTIPE, LedeData.TAAL, CAST(DATEADD(year, 21, CONVERT(datetime, PlakkerData.GebDat, 101)) AS varchar(12)) AS gebdat FROM PlakkerData LEFT OUTER JOIN LedeData ON PlakkerData.Lidno = LedeData.LIDNO WHERE (PlakkerData.KorrCode = 89) AND (LedeData.CheckAudit = 0))
Oct 26 '10 #1
1 2204
ck9663
2,878 Expert 2GB
That's a LEFT JOIN... Try replacing LEFT OUTER with INNER.

Happy Coding!!!

~~ CK
Oct 27 '10 #2

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

Similar topics

1
by: DataB | last post by:
Hi Everyone! I have, essentially, two table structures in the same ms access database file. Both are of the parent-child format, one parent table with personal details, then multiple child...
1
by: Moojjoo | last post by:
Good Monday Morning: I am at a dead stop and I am hoping some other developers out there can help me out. I have built a dataset that first contains a table populated from SQL Server then I am...
14
by: Peter | last post by:
Is there a fast way to move data from DataTable into double array, or do I have to spin through every record and column? I have five tables and I need to merge these tables column wise, each table...
3
by: Eric | last post by:
When i run my query it transfer last 4 digits of account number from one table to another and its wrong. There are two tables one i use for parsing. Second thru query i use to move data from temp...
6
by: CoolForU | last post by:
This is my table tblName Pid PName Country ------------------------------------------------------------------ 100 Shantosh India 102 Mukesh India 103 Rakesh India
1
by: vasanthan | last post by:
i have two tables .. service master with ID,servicename.....it contains 5 records.. system master with ID,systemnane--it contains 3 records.. i want to displays records as.... sysId ...
3
by: Cyprus106 | last post by:
I need to select data from two tables in one statement. The tables do have a common key field, but they're named differently: One is MPPONO and the other is just plain PPONO... Can anybody tell me...
5
by: veekoul | last post by:
Hi All, I have a sql which fetches large number of records and then i use the one column value and do a select on other table in other DB. I want to do it on the fly as i dont want to use any temp...
0
by: Khutija Tayyaba | last post by:
Hi, I have 3 tables in mysql **User** --------------------- `id` (auto increment)(PK) `user_name` `password` `first_name` `last_name` `created_at`
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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,...
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.