Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to use an append query to add a record to a table 1

Status
Not open for further replies.

vba317

Programmer
Mar 5, 2009
708
US
I am still unsure about using append queryies to add a record to a table.
TableName: dbo_rpt_dic_Dpt
Field1: dbo_rpt_dic_Dpt.clntid
Field2: dbo_rpt_dic_Dpt.dptid
Field3: dbo_rpt_dic_Dpt.dptdesc
Field4: dbo_rpt_dic_Dpt.rptdpt
What I would like to do is add the record
dbo_rpt_dic_Dpt.clntid = 94
dbo_rpt_dic_Dpt.dptid = 15
dbo_rpt_dic_Dpt.dptdesc = "MT SAN RAFAEL HOSPITAL"
dbo_rpt_dic_Dpt.rptdpt = "MT SAN RAFAEL HOSPITAL"

Will the query I wrote do this?


Code:
INSERT INTO dbo_rpt_dic_Dpt ( 94, 15, [" MT SAN RAFAEL HOSPITAL"], ["MT SAN RAFAEL HOSPITAL"] )
SELECT dbo_rpt_dic_Dpt.clntid, dbo_rpt_dic_Dpt.dptid, dbo_rpt_dic_Dpt.dptdesc, dbo_rpt_dic_Dpt.rptdpt
FROM dbo_rpt_dic_Dpt;
 
INSERT INTO dbo_rpt_dic_Dpt ( clntid, dptid, dptdesc, rptdpt )
VALUES ( 94, 15, 'MT SAN RAFAEL HOSPITAL', 'MT SAN RAFAEL HOSPITAL' )

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top