you can not use special characters (such as $) in this query
$AGLCLTAX_THRU_DT
for variables in sql server you need
to declare variable first then
use as
@AGLCLTAX_THRU_DT
http://ms
Main Topics
Browse All TopicsWe are in the process of upgrading our PeopleSoft database platform from SQL Server 2000 to 2005. During our testing we ran into a problem with 2005 in that it requires the use of ANSI Standard Outer Joins but some of our custom SQRs use Non-ANSI standard joins.
When we made the necessary ANSI Standard changes to the programs we ran into errors from putting dynamic variables into the FROM clause of a Select statement. We want to avoid changing the compatibility level back to 8.0 so we need to get all of the queries using ANSI Standard Outer Joins. I'm getting the following errors when running the modified SQRs:
(SQR 1303) Error in SQL (perhaps missing &name after expression):
(SQR 1304) Check SELECT columns, expressions and 'where' clause for syntax.
The code that is referenced below is all in a Begin-Select statement and when the query is run in MS Query Analyzer it runs successfully.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
you can not use special characters (such as $) in this query
$AGLCLTAX_THRU_DT
for variables in sql server you need
to declare variable first then
use as
@AGLCLTAX_THRU_DT
http://ms
Business Accounts
Answer for Membership
by: dportasPosted on 2009-06-27 at 11:45:34ID: 24728815
Try the following (untested).
SELECT *
FROM PS_PAY_TAX TBAL
LEFT OUTER JOIN
( SELECT STATE, LOCALITY, TAX_GRP_TYPE, MAX(EFFDT) EFFDT
FROM PS_LOCL_TX_TYP_TBL
WHERE EFFDT <= #AGLCLTAX_THRU_DT
GROUP BY STATE, LOCALITY, TAX_GRP_TYPE
) LTTT1
ON TBAL.STATE = LTTT1.STATE
AND TBAL.LOCALITY = LTTT1.LOCALITY
LEFT OUTER JOIN PS_LOCL_TX_TYP_TBL LTTT2
ON LTTT1.STATE = LTTT2.STATE
AND LOCALITY = LTTT.LOCALITY
AND TAX_GRP_TYPE = LTTT.TAX_GRP_TYPE
AND LTT1.EFFDT = LTT2.EFFDT ;