SQL INSERT question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to insert 3 columns into a table, the first column comes from a SELECT
from another table, the second and third columns are fixed values. Does
anyone know how to code this INSERT in SQL. I'm not using the query designer.
Thanks

So far I have:

strSQL = "INSERT INTO tblRuleDates (RuleID,DateTypeID,TargetDate)" & _
" (SELECT RuleID FROM tblPkgRuleXref" & _
" WHERE PkgID = " & lngPkgID & ")"
 
Where are the "fixed values" coming from? Are they memory variables?

strSQL = "INSERT INTO tblRuleDates (RuleID,DateTypeID,TargetDate)" & _
" SELECT RuleID," & lngDateTypeID & ", #" & datDateVal & _
"# FROM tblPkgRuleXref" & _
" WHERE PkgID = " & lngPkgID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top