Re: Extract data to new fields
From: Gordzilla (gordzilla2000_at_hotmail.com)
Date: 03/24/04
- Next message: Jeff Boyce: "Re: Database Design"
- Previous message: Ashbee: "Re: Database Design"
- In reply to: John Vinson: "Re: Extract data to new fields"
- Next in thread: Tim Ferguson: "Re: Extract data to new fields"
- Reply: Tim Ferguson: "Re: Extract data to new fields"
- Reply: Rodrigo: "Re: Extract data to new fields"
- Reply: Gordzilla: "Re: Extract data to new fields"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Mar 2004 21:06:02 -0500
Not that simple.
On the line indicated below, I need the fieldname to be evaluated but with
the quotes
strSql = "INSERT INTO "
strSql = strSql & " tmpNewSurvey "
strSql = strSql & " ( SurveryId, Question, Response ) "
strSql = strSql & " SELECT "
strSql = strSql & " SurveryId "
strSql = strSql & " , " & """" & fld.name & """" & " AS
Question "
===> strSql = strSql & " , " & """" & fld.name & """" & " AS Response
"
strSql = strSql & " FROM "
strSql = strSql & " tblSurvey ; "
Currently it gives me strSQL ="INSERT INTO tmpNewSurvey ( SurveyId,
Question, Response ) SELECT SurveyId , "P1S1Q01" AS Question ,
"P1S1Q01" AS Response FROM tblSurvey ; "
and I need
strSQL ="INSERT INTO tmpNewSurvey ( SurveyId, Question, Response )
SELECT SurveyId , "P1S1Q01" AS Question , P1S1Q01 AS Response FROM
tblSurvey ; "
"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:4pc160h45rg5vosod9hpb4vejst0uhq076@4ax.com...
> On Tue, 23 Mar 2004 13:46:15 -0800, "Gordzilla2000"
> <anonymous@discussions.microsoft.com> wrote:
>
> >So close.
> >
> >The fld.value comes up as an error every time.
> >I change both of them to read fld.name
> >Which results in the following SQL statement:
> >
> >"INSERT INTO tmpNewSurvey ( SurveyId, Question, Response ) SELECT
SurveyId , "P1S1Q01" AS Question , "P1S1Q01" AS Response FROM
tblSurvey ; "
> >
> >This is perfect except the Response portion should read P1S1Q01 AS
Response with no " around the field name.
> >This SQL statement gives me the exact extraction I need. I just can't
figure out how to amend strSql to get rid of the "
>
> Replace them with [Square brackets]:
>
> INSERT INTO tmpNewSurvey ( SurveyId, Question, Response ) SELECT
> SurveyId , [P1S1Q01] AS Question , [P1S1Q01] AS Response FROM
> tblSurvey ;
>
> John W. Vinson[MVP]
> Come for live chats every Tuesday and Thursday
> http://go.compuserve.com/msdevapps?loc=us&access=public
- Next message: Jeff Boyce: "Re: Database Design"
- Previous message: Ashbee: "Re: Database Design"
- In reply to: John Vinson: "Re: Extract data to new fields"
- Next in thread: Tim Ferguson: "Re: Extract data to new fields"
- Reply: Tim Ferguson: "Re: Extract data to new fields"
- Reply: Rodrigo: "Re: Extract data to new fields"
- Reply: Gordzilla: "Re: Extract data to new fields"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|