Reputation:
I would appreciate your support to understand what is wrong with the code below:
SELECT [Name] As Milestone, [Start], [Outgoing tasks] As OTask
FROM [Sheet1$]
WHERE [Main project] = 'Company A' AND [Main link] = 'Project 1'
AND [Task class] = 'Company'
AND [Start] > (SELECT [Start]
FROM [Sheet1$]
WHERE [Main project] = 'Company A'
AND [Main link] = 'Project 1'
AND [Name] = OTask
AND [Incoming tasks] = Milestone)
What I am actually trying to do is getting the registry (Name
) which happens after its successor (Outgoing tasks
).
Is there an issue with my parameters (Milestone and OTask)?
ERROR: NO VALUE GIVEN FOR ONE OR MORE REQUIRED PARAMETERS
Thanks!!!
Upvotes: 1
Views: 74
Reputation: 16512
The problem is that you use your alias in your where condition.
It should look like this instead
SELECT [Name] As Milestone, [Start], [Outgoing tasks] As OTask
FROM [Sheet1$]
WHERE [Main project] = 'Company A' AND [Main link] = 'Project 1'
AND [Task class] = 'Company'
AND [Start] > (SELECT [Start]
FROM [Sheet1$]
WHERE [Main project] = 'Company A'
AND [Main link] = 'Project 1'
AND [Name] = [Outgoing tasks]
AND [Incoming tasks] = [Name])
You have to replace OTask
by [Outgoing tasks]
and Milestone
by [Name]
Upvotes: 2