SQL INSERT question

M

mscertified

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 & ")"
 
D

Duane Hookom

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
 
Top