Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Variables in SQL?

Author  Topic 

mikecollins
Starting Member

2 Posts

Posted - 2007-06-05 : 11:25:21
Basically I am creating a wizard(using forms) within a database to import client files and reformat them into the format that we need.

I have a form that list all 26 column headings that I need and tied to each column headings is a combo box that that lists the column headings from the imported client file.

I need to create a query that either appends it to an already formatted file or creates a new table with the column headings.

The problem is the field headings from the imported file change.
This is the sql that I used that doesn't work:

INSERT INTO Formatted_Data ( Field X )
SELECT Imported_Data.Forms![Import Data-3]![Combo33]
FROM Imported_Data;

Because Imported_Data.Forms![Import Data-3]![Combo33] is not recognized. I think if I could create a variable to replace the Forms! part then it would work but I do not know how to do this,

Thanks in advance to anyon that can help

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-06-05 : 12:02:24
Are you sure you are not using Access?

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

mikecollins
Starting Member

2 Posts

Posted - 2007-06-05 : 12:08:49
No I am using Access, but I am using SQL to write a query. If there is a way to make the query in design mode that would work too.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-06 : 09:52:32
Post your question at Access Forum

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -