Syntax Error

G

Guest

I have been given this code below to use but I keep on getting a syntax error
and I cannot see it. Please can anyone help.

Start Date: (SELECT c.calendar_date FROM Calendar AS c WHERE
c.work_day = 1 AND c.holiday = 0 AND c.calendar_date < [a.Ship
Date] AND c.calendar_date >= DATEADD("d",-(([a.Lead Time Days]
* 2) + 14),[a.Ship Date]) AND [a.Lead Time Days] = (SELECT
COUNT(* ) FROM Calendar c2 WHERE c2.calendar_date < [a.Ship
Date] AND c2.calendar_date >= .calendar_date AND c2.work_day
= 1 AND c.holiday = 0))

Thank you
 
G

Guest

[a.Ship Date] [a.Lead Time Days]
I do not see a table or alias of "a" in the FROM clause.

c2.calendar_date >= .calendar_date
Somthing is missing in front of the second calendar_date. Probably a c.
 
G

Guest

Found another I think:
AND c.holiday = 0))

As this is in the subquery, it probably needs to be:
AND c2.holiday = 0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

syntax error in multiple update query 4
CALENDAR CREATION 1
Recordset Findfirst Date Issue 0
date syntax 2
Windows XP Closing stock Forecast formula 0
syntax error 1
Run function from macro 1
order by in inner select 1

Top