Execute Two Statments In Query

crhodus

Registered User.
Local time
Today, 01:58
Joined
Mar 16, 2001
Messages
257
Is there a way to execute two statements in one query in access? I tried the following but received the following: "Characters found at the end of the SQL statment".

Here is what I have in my qryUpdateRecords file:

"UPDATE dbo_CE, tblCE_Details SET tblCE_Details.LIC_NUMBER = [dbo_CE].[LICENSE_NUM], tblCE_Details.Credit_Hours = [dbo_CE].[CREDIT_HOURS], tblCE_Details.Course_Sponsor = [dbo_CE].[COURSE_SPONSOR], tblCE_Details.Course_Name = [dbo_CE].[COURSE_NAME], tblCE_Details.Auth_Code = [dbo_CE].[AUTH_CODE], tblCE_Details.Category = [dbo_CE].[CATEGORY], tblCE_Details.Course_Date = [dbo_CE].[COURSE_DATE], tblCE_Details.ImportDate = Now() WHERE ([dbo_CE].EXPORT_TIMESTAMP IS NULL ) ; UPDATE dbo_CE SET([dbo_CE].EXPORT_TIMESTAMP = NOW() WHERE ([dbo_CE].EXPORT_TIMESTAMP IS NULL);"


Thanks,
CRhodus
 
Simple Software Solutions

Why are you trying to run two queries at once?

Why not simply run them one after the other?
 
Yep, make two seperate queries and use either a macro or vb code to run them as "one"
 
Observations from first glance:

1. The first part of your query updates two tables but you have no join syntax. Beware of implicit permutation joins.

2. The second query would update a field that is in one of the tables named in the first part of the query AND appears to use the same WHERE criteria. If you get the first update to work, include that second update in list of fields to update for the first query.
 

Users who are viewing this thread

Back
Top Bottom