473,949 Members | 17,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to append data with selected data plus values?

31 New Member
Greetings,

This is probably an easy thing to do, but I can't seem to figure it out. My main data set is a massive table with 15 columns and thousands of rows. The data entry form forces certain consistencies in the data (if column A = "bluejay", column B = "bird"). However, I've agreed to upload archived data from a previous source where these consistencies were not enforced. So, I wrote 10 or so queries looking for specific inconsistencies .

What I want to do is simple: I want to turn those 10 select queries into append queries and add them to tbl_errors; tbl_errors has one extra column called 'Error Type'. When when qry_append_1 adds its lines, I want it insert a value into tbl_error.[Error Type], something that simply tells me what query it came from (the text "qry_append _1" would be fine).

It's got to be something like:
Expand|Select|Wrap|Line Numbers
  1. "INSERT INTO tbl_errors SELECT tbl_source.* FROM tbl_source WHERE [condition 1]...;"
  2.  
"
combined with:
Expand|Select|Wrap|Line Numbers
  1. "INSERT INTO tbl_errors.[Error Type] VALUES (qry_append_1)...;"
  2.  
Do I need some sort of UNION of the two?
Feb 25 '11 #1
3 1602
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Im not 100% sure, but I think this should do:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO tbl_errors SELECT tbl_source.*,'qry_Append_1' FROM tbl_source WHERE [condition 1]...;
Notice the single ' around the string qry_Append_1
Feb 25 '11 #2
tetsuo2030
31 New Member
This is close!! I figured it out:
Expand|Select|Wrap|Line Numbers
  1. "INSESRT INTO tbl_errors ([fld1], [fld2], ..., [Error Type]) SELECT tbl_source.[fld1], tbl_source.[fld2],..., 'qry_append_1' AS [Error Type] FROM tbl_source WHERE...;"
  2.  
Feb 25 '11 #3
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Im very glad that you got it figured out.
Feb 25 '11 #4

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

Similar topics

0
2893
by: elcc1958 | last post by:
I need to support a VB6 application that will be receiving disconnected ADODB.Recordset from out DotNet solution. Our dotnet solution deals with System.Data.DataTable. I need to populate a disconnected ADODB.Recordset from System.Data.DataTable data. Below is the source code I am implementing to test the process. I do not get any error, that I can see. The problem I have is that at the end, the recordset seems to be empty. Any...
2
2723
by: Apple | last post by:
I had create a query with one table and one query, and then create form with that query using wizard, but I can't append or edit data in that form & query. Please help!
5
2603
by: \A_Michigan_User\ | last post by:
I'm using asp.net/vb.net/ado.net to create a very simple user interface. (Everything works if I use STATICALLY created textBoxes... but not when I make them DYNAMICALLY.) 1. Execute a SQL SELECT cmd to retrieve a record. 2. Loop through the dataReader values, creating textBox boxes dynamically, adding them to a Panel. (The database values are placed in these textboxes.)
2
1397
by: tamatem | last post by:
I made ahuge load script in SQL Server 2000 as i load data from many tables(select some of each one collumns) into one single table and i want to test the loaded data against the selected data to make sure that the loaded data is the same the selected data is there a code or tool to make this test or monitoring ?? please urgent ....
1
3349
by: David | last post by:
Under asp.net 2, if I define SqlDatasource and bind it to a grid, is selected data accessible in code? Eg. if I select s single row from the grid, can I go to the base data from the SqlDatasource and get the specific row? If yes, then point me to an example. Also, I know that can selected grid row or I can select the single row from the database. Thanks
0
782
by: sravan_reddy001 | last post by:
i found the folloling error message when tried to administer the login control of the webpage:: There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. The following message may help in...
2
1463
by: Steve Kershaw | last post by:
Hello, I'm trying to bind a DirectoryInfo array to a GridView (.DataBind();). Whenever I hit the gridDirList.DataBind(); method I get the error: A field or property with the name 'ListWriteTime' was not found on the selected data source. Can somebody explain this error and what I can do to avoid it?
0
1382
by: svgeorge | last post by:
I have web pages for making several 9 type of payments. The data gets loaded on web page from SQL server 2005 database. Then I have Process payment button(ProcPaymBTM_Click) on the web page(Detail View)This is done. on clicking this button(ProcPaymBTM_Click) on (Detail View) all selected (checked) data columns needs displayed on another page (Review Data) In this page i click confirm payment button to insert selected data to the SQL Tables. I...
2
1749
by: munther | last post by:
hi there : i was created datagrid and it have three template colume, in the template colume dropdownlist the dropdownlist get data from data base . * the question i want return selected value from dropdownlist ? please if any one know solution tell me by gruop or by e-mail mazzah@aseza.jo best regard
2
2050
by: sivasweety | last post by:
I have created a List of contents in a database table which will display in Datagrid window. The user may select one or many data from the Datagrid. If data selected data should be shown in Another datagrid. If a content is not available user may be allowed to add additional 'List of contents'. The addl. data also to be included automatically in that database table. The project is for our deaf association. Advance thanks pl.
0
9990
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
11593
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
11189
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11360
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6129
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
6349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4955
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
4546
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3554
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.