By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

Make table query not working

P: 14
I have a query from which I would like to make a table named 18H. When I run this along with some other queries as an event procedure, it does not work. If I run it manually, it works fine.

Not sure what's happening; I do have some criteria where it makes sure it picks the correct data by stating this time is between a start and end time on the other table.

Expand|Select|Wrap|Line Numbers
  1. SELECT [SP-Pick].DDate, [SP-Pick].EmpNo, [SP-Pick].TTime, [tbl Emp Data].[Job#], [tbl Emp Data].Task, [tbl Emp Data].Start, [tbl Emp Data].End INTO 18h
  2. FROM [SP-Pick] INNER JOIN [tbl Emp Data] ON ([SP-Pick].EmpNo = [tbl Emp Data].[Emp$]) AND ([SP-Pick].DDate = [tbl Emp Data].AdjustedDate)
  3. WHERE ((([tbl Emp Data].Task) Is Not Null) AND (([tbl Emp Data].Start)<[Sp-Pick]![TTime]) AND (([tbl Emp Data].End)>[SP-Pick]![TTime]));
May 18 '17 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 15k+
P: 31,492
You tell us it doesn't work without giving any details of what happens.

If you're seriously after some help then may I suggest you give some little thought to your question.
May 18 '17 #2

Expert 100+
P: 1,430
As usual I agree with Neopa - lack of information, but I would be very suspicious of the # in Job#, and I'm not over happy about the minus sign is say SP-Pick. I suggest JobNo and use an underscore instead of the minus. End is a reserved word, so I would either change it or put square brackets round it.

The above is all guess work

Have you pasted your SQL from your VBA back into a query to see if that gives an error?

May 18 '17 #3

Post your reply

Sign in to post your reply or Sign up for a free account.