P
Patricia
I had posted this message before and I have code that we cannot get to work
in Access, it will not insert the slots - what is wrong?
INSERT INTO [Schedule] ( [Schedule].[Monday], [Schedule].[Customer])
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 1
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 2
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 3
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 4
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 5;
in Access, it will not insert the slots - what is wrong?
Code:Newbie question: I have a database where we track dispatched with two
tables, one called Slots, the other called Dispatches.
In the slots table there are 2 fields, one called Week (which hold the
Monday date for each week in the year), the other called Available (in
this field we want to manually enter a number that will tell the system
how many dispatches we can do that week). We want to automatically take
the number from the Slots.Available and enter X number of blank records
in the Dispatch table with the monday date.
How can this be done?
Then we will create a form that can be filled in with the balance of
the information.
Thanks
INSERT INTO [Schedule] ( [Schedule].[Monday], [Schedule].[Customer])
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 1
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 2
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 3
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 4
UNION ALL
SELECT [Monday].[Monday] AS [FirstDayOfWeek] , '' AS [Customer] from
[Monday] where [Monday].[Monday] not in (select [Monday] from [Schedule]) and
[Monday].[slots] >= 5;