Append query

krzysiekk

Registered User.
Local time
Today, 13:17
Joined
Dec 2, 2009
Messages
74
Hi I wrote insert query in t-sql but I need that query implement as vba script in access

insert into #vttrailerm (trailer, trailer_date)
select trailer_ref, Convert(char(6), required_date, 12)
from #vttpstatm S
where not exists (select * from #vttrailerm where Convert(datetime, '20' + trailer_date) = S.required_date);

Can anyone help me?
 
This is not a valid where clause. You should outer join the tables. It's faster.

Are you sure you want a vba script in Access to execute this query?

Did you connect the temporary tables #vttrailerm and #vttpstatm to the Access database?

Required Date is converted to Char(6) and TrailerDate is converted to DateTime. It's like comparing apples to pears. You will never get a match.

You are using which Access version?
 
I using access 2003.

If not vba maybe access qury?
I need created event for combo after update
 

Users who are viewing this thread

Back
Top Bottom