Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SQL INSERT INTO

 
   Database Help (Home) -> Visual Basic -> ODBC RSS
Next:  vb6 ado and connectionstring  
Author Message
Utf-8BSnR5bGVy

External


Since: May 07, 2004
Posts: 1



(Msg. 1) Posted: Fri May 07, 2004 11:36 am
Post subject: SQL INSERT INTO
Archived from groups: microsoft>public>vb>database>odbc (more info?)

consider the following SQL statement:

INSERT INTO tblConferenceFormsDetails([ConferenceTypeID], [FormName]) VALUES(SELECT Max(ConferenceTypeID) AS MaxID FROM [tblConferenceTypeLookup], 'IEP Service Goal Form W-1');

is it not possible, when wanting to insert a single record, to imbed a SELECT statement within the VALUES argument of the INSERT INTO? i want to append one record. my second value is a string, and my 1st (the SQL) will return only one value... why wont this work???

thanks,
J

 >> Stay informed about: SQL INSERT INTO 
Back to top
Login to vote
Douglas J. Steele

External


Since: Mar 14, 2004
Posts: 1626



(Msg. 2) Posted: Fri May 07, 2004 9:04 pm
Post subject: Re: SQL INSERT INTO [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

INSERT INTO tblConferenceFormsDetails([ConferenceTypeID], [FormName])
SELECT Max(ConferenceTypeID) AS MaxID, 'IEP Service Goal Form W-1'
FROM [tblConferenceTypeLookup];


--
Doug Steele, Microsoft Access MVP
<a style='text-decoration: underline;' href="http://I.Am/DougSteele" target="_blank">http://I.Am/DougSteele</a>
(No private e-mails, please)



"Jtyler" <anonymous.RemoveThis@discussions.microsoft.com> wrote in message
news:65A4827F-EA3F-4366-A4E4-65952E98E28C@microsoft.com...
 > consider the following SQL statement:
 >
 > INSERT INTO tblConferenceFormsDetails([ConferenceTypeID], [FormName])
VALUES(SELECT Max(ConferenceTypeID) AS MaxID FROM [tblConferenceTypeLookup],
'IEP Service Goal Form W-1');
 >
 > is it not possible, when wanting to insert a single record, to imbed a
SELECT statement within the VALUES argument of the INSERT INTO? i want to
append one record. my second value is a string, and my 1st (the SQL) will
return only one value... why wont this work???
 >
 > thanks,
 > J<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: SQL INSERT INTO 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic -> ODBC All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]