OK, I am too used to the query genies in Access and have trouble rewriting sql queries that will work in Alpha.
In Access, the SQL view of an INSERT query is below. In my query, I am appending (or inserting) multiple records with a JOB_CODE of H to the same
table but with a JOB_CODE from the form I'm on. In other words, I am copying all records from H job to another job.
I named the field to append to JOB_CODE JOB with reference to Forms!FrmJobSetupNewJobs!JOB_CODE. Here's the SQL view from Access:
In Alpha, the above syntax does not work, of course, so I have tried several iterations, but not surprisingly, none of them work.
Here's one of them:
Any suggestions?
In Access, the SQL view of an INSERT query is below. In my query, I am appending (or inserting) multiple records with a JOB_CODE of H to the same
table but with a JOB_CODE from the form I'm on. In other words, I am copying all records from H job to another job.
I named the field to append to JOB_CODE JOB with reference to Forms!FrmJobSetupNewJobs!JOB_CODE. Here's the SQL view from Access:
Code:
INSERT INTO TblJobsPriorityMeasures ( JOB_CODE, MEASURE, QUANTITY, PRIORITY_NUM ) SELECT Forms!FrmJobSetupNewJobs!JOB_CODE AS JOB, TblJobsPriorityMeasures.MEASURE, TblJobsPriorityMeasures.QUANTITY, TblJobsPriorityMeasures.PRIORITY_NUM FROM TblJobsPriorityMeasures WHERE (((TblJobsPriorityMeasures.JOB_CODE)="H"));
Here's one of them:
Code:
dim jobCode as c jobCode = e.session.specsJobCode dim sqlInsertStatement as c dim args as sql::arguments args.add("JOB_CODE",jobCode) args.add("HJob","H") sqlInsertStatement = <<%sqltxt% INSERT INTO TblJobsPriorityMeasures (JOB_CODE, MEASURE, QUANTITY, PRIORITY_NUM) VALUES (SELECT :JOB_CODE as JOB_CODE, MEASURE, QUANTITY, PRIORITY_NUM FROM TblJobsPriorityMeasures WHERE JOB_CODE = :HJob) %sqltxt% cn.Execute(sqlInsertStatement,args) (etc., etc.)
Comment