Hi guys..
When I try and run the following code it says that there is a missing
operator..
SELECT
curr.portfolio_ code,
curr.date,
(curr.gross_ind ex-mo1.gross_index )/mo1.gross_index AS 1MONTH_RETURN,
(curr.gross_ind ex-mo1.gross_index )/mo1.gross_index AS 3MONTH_RETURN
FROM portfolio_perfo rmance AS curr
LEFT OUTER JOIN portfolio_perfo rmance AS mo1
ON curr.date =
dateserial(year (dateadd('d',-1,dateserial(Ye ar([mo1].date),
MONTH([mo1].date)+2, 1))),
month(dateadd(' d',-1,dateserial(Ye ar([mo1].date), MONTH([mo1].date)+2,
1))),day(datead d('d',-1,dateserial(Ye ar([mo1].date),MONTH([mo1].date)+2,
1))))
LEFT OUTER JOIN portfolio_perfo rmance AS mo3
ON curr.date =
dateserial(year (dateadd('d',-1,dateserial(Ye ar([mo3].date),
MONTH([mo3].date)+4, 1))),
month(dateadd(' d',-1,dateserial(Ye ar([mo3].date), MONTH([mo3].date)+4,
1))),day(datead d('d',-1,dateserial(Ye ar([mo3].date),MONTH([mo3].date)+4,
1))))
;
However, when I run the same code, minus the second left outer join it
works perfectly..
SELECT
curr.portfolio_ code,
curr.date,
(curr.gross_ind ex-mo1.gross_index )/mo1.gross_index AS 1MONTH_RETURN
FROM portfolio_perfo rmance AS curr
LEFT OUTER JOIN portfolio_perfo rmance AS mo1
ON curr.date =
dateserial(year (dateadd('d',-1,dateserial(Ye ar([mo1].date),
MONTH([mo1].date)+2, 1))),
month(dateadd(' d',-1,dateserial(Ye ar([mo1].date), MONTH([mo1].date)+2,
1))),day(datead d('d',-1,dateserial(Ye ar([mo1].date),MONTH([mo1].date)+2,
1))));
Any help would be appreciated.. im sure its only something minor!
When I try and run the following code it says that there is a missing
operator..
SELECT
curr.portfolio_ code,
curr.date,
(curr.gross_ind ex-mo1.gross_index )/mo1.gross_index AS 1MONTH_RETURN,
(curr.gross_ind ex-mo1.gross_index )/mo1.gross_index AS 3MONTH_RETURN
FROM portfolio_perfo rmance AS curr
LEFT OUTER JOIN portfolio_perfo rmance AS mo1
ON curr.date =
dateserial(year (dateadd('d',-1,dateserial(Ye ar([mo1].date),
MONTH([mo1].date)+2, 1))),
month(dateadd(' d',-1,dateserial(Ye ar([mo1].date), MONTH([mo1].date)+2,
1))),day(datead d('d',-1,dateserial(Ye ar([mo1].date),MONTH([mo1].date)+2,
1))))
LEFT OUTER JOIN portfolio_perfo rmance AS mo3
ON curr.date =
dateserial(year (dateadd('d',-1,dateserial(Ye ar([mo3].date),
MONTH([mo3].date)+4, 1))),
month(dateadd(' d',-1,dateserial(Ye ar([mo3].date), MONTH([mo3].date)+4,
1))),day(datead d('d',-1,dateserial(Ye ar([mo3].date),MONTH([mo3].date)+4,
1))))
;
However, when I run the same code, minus the second left outer join it
works perfectly..
SELECT
curr.portfolio_ code,
curr.date,
(curr.gross_ind ex-mo1.gross_index )/mo1.gross_index AS 1MONTH_RETURN
FROM portfolio_perfo rmance AS curr
LEFT OUTER JOIN portfolio_perfo rmance AS mo1
ON curr.date =
dateserial(year (dateadd('d',-1,dateserial(Ye ar([mo1].date),
MONTH([mo1].date)+2, 1))),
month(dateadd(' d',-1,dateserial(Ye ar([mo1].date), MONTH([mo1].date)+2,
1))),day(datead d('d',-1,dateserial(Ye ar([mo1].date),MONTH([mo1].date)+2,
1))));
Any help would be appreciated.. im sure its only something minor!
Comment