p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Access and Access VBA > Access VBA
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 4th, 2006, 04:28 AM
Authorized User
 
Join Date: Jul 2006
Location: Kolkata, West Bengal, India.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to lawsoncobol
Default Error in SQL INSERT query

Hi friends

      I have to update a table name Mismatch, The query name is QtrTxble

__________________________________________________ _________________________

SQL QUERY

INSERT INTO Mismatch ( Mismatch.row, Mismatch.SSN, Mismatch.QtrTxble, Mismatch.YtdTxble, Mismatch.QtrAmt, Mismatch.YtdAmt, Mismatch.QtrGross, Mismatch.YtdGross )
SELECT File1.row, File1.SSN, File1.QtrTxbl, File1.YtdTxbl, File1.QtrAmt, File1.YtdAmt, File1.QtrGross, File1.YtdGross
FROM FILE1 INNER JOIN File2 ON File2.SSN=File1.SSN
WHERE ((File1.QtrTxbl)<>(File2.QtrTxbl)) AND ((File1.YtdTxbl)=(File2.YtdTxbl)) AND ((File1.QtrAmt)=(File2.QtrAmt)) AND ((File1.YtdAmt)=(File2.YtdAmt)) AND ((File1.QtrGross)=(File2.QtrGross)) AND ((File1.YtdGross)=(File2.YtdGross));
__________________________________________________ _________________________


Error :

The INSERT INTO statement contains the following unknown field name:'Mismatch.row'. Make sure you have typed the name correctly

__________________________________________________ _________________________


Table Mismatch structure
row (key) Number
SSN Text
QtrTxble "
YtdTxble "
QtrAmt "
YtdAmt "
QtrGross "
YtdGross "
__________________________________________________ _________________________

Table File1 Structure

row (key) Number
Key1 Number
SSN Text
QtrTxble "
YtdTxble "
QtrAmt "
YtdAmt "
QtrGross "
YtdGross "
__________________________________________________ _________________________

Table File2 Structure

row (key) Number
Key1 Number
SSN Text
QtrTxble "
YtdTxble "
QtrAmt "
YtdAmt "
QtrGross "
YtdGross "

 Please help me , where i am wrong?
__________________________________________________ _________________________


Thanks and Regards
Lawson, COBOL
__________________
Thanks and Regards
Lawson, COBOL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old August 4th, 2006, 05:25 AM
Authorized User
 
Join Date: Jul 2006
Location: Kolkata, West Bengal, India.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to lawsoncobol
Default

Hi friends i figured it out

SQL QUERY

INSERT INTO Mismatch ( MISTAKE ( table name mismatch should not be there )--> Mismatch.row, Mismatch.SSN, Mismatch.QtrTxble, Mismatch.YtdTxble, Mismatch.QtrAmt, Mismatch.YtdAmt, Mismatch.QtrGross, Mismatch.YtdGross )
SELECT File1.row, File1.SSN, File1.QtrTxbl, File1.YtdTxbl, File1.QtrAmt, File1.YtdAmt, File1.QtrGross, File1.YtdGross
FROM FILE1 INNER JOIN File2 ON File2.SSN=File1.SSN
WHERE ((File1.QtrTxbl)<>(File2.QtrTxbl)) AND ((File1.YtdTxbl)=(File2.YtdTxbl)) AND ((File1.QtrAmt)=(File2.QtrAmt)) AND ((File1.YtdAmt)=(File2.YtdAmt)) AND ((File1.QtrGross)=(File2.QtrGross)) AND ((File1.YtdGross)=(File2.YtdGross));

so it should be

INSERT INTO Mismatch (row,SSN,QtrTxble,YtdTxble,QtrAmt,YtdAmt,QtrGross, YtdGross )
SELECT File1.row, File1.SSN, File1.QtrTxbl, File1.YtdTxbl, File1.QtrAmt, File1.YtdAmt, File1.QtrGross, File1.YtdGross
FROM FILE1 INNER JOIN File2 ON File2.SSN=File1.SSN
WHERE ((File1.QtrTxbl)<>(File2.QtrTxbl)) AND ((File1.YtdTxbl)=(File2.YtdTxbl)) AND ((File1.QtrAmt)=(File2.QtrAmt)) AND ((File1.YtdAmt)=(File2.YtdAmt)) AND ((File1.QtrGross)=(File2.QtrGross)) AND ((File1.YtdGross)=(File2.YtdGross));

Thanks and Regards
Lawson, COBOL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 12:17 PM
Error 'SQL_C_NUMERIC' with param Insert query bnorg MySQL 0 December 16th, 2006 07:30 PM
Insert multiple records using one SQL Query. Deepak Chauhan SQL Language 3 April 12th, 2006 08:43 AM
HELP! Insert Query Error zrm22 Classic ASP Databases 1 January 30th, 2006 06:34 PM
Pass-Through SQL Insert Query bmwbear Access 1 October 18th, 2004 01:43 AM



All times are GMT -4. The time now is 07:03 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc