Token Error in iSeries Navigator

365 pts.
Tags:
AS/400 errors
iSeries Navigator
Help - what's wrong with my query: (Getting Token Error, From Into Clause)

SELECT DISTINCT "T16.CPRP".CP_TOWNSHIP, "T16.CBL".CB_INTEREST_CITY MINUS ("T16.CBL".CB_TAXCOLL * .03) AS Interest, SUM ("T16.CTDT".TD_DETAIL_AMT_01) as Payments

FROM QS36F."T16.CPRP" AS "T16.CPRP", QS36F."T16.CBL" AS "T16.CBL", QS36F."T16.CTDT" AS "T16.CTDT"

WHERE "T16.CPRP".CP_YEAR = “T16.CBL”.CB_YEAR AND “T16.CPRP”.CP_TAXBILL_NO = “T16.CBL”.CB_TAXBILL_NO AND “T16.CPRP.CP_ROLL_TYPE = “T16.CBL”.CB_ROLL_TYPE AND “T16.CBL”.CB_YEAR = “T16.CTDT”.TD_YEAR AND “T16.CBL_TAXBILL_NO = “T16.CTDT”.TD_TAXBILL_NO AND “T16.CBL”.CB_ROLL_TYPE = “T16.CTDT”.TD_ROLL_TYPE

GROUP BY “T16.CPRP”.CP_TOWNSHIP;

Answer Wiki

Thanks. We'll let you know when a new response is added.

1. I don’t tink the word minus is supported use -
2. remove the DISTINCT
3. GROUP BY “T16.CPRP”.CP_TOWNSHIP, Interest
must include all columns that are not sum/max/min etc.

I doubt that it will do what you want but I’m doubting that it will give the results you’re after.
Phil

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    On what platform?
    66,295 pointsBadges:
    report
  • lorit
    Iseries Navigator
    365 pointsBadges:
    report
  • lorit
    I am guessing I use "sub" instead of minus to substract. I modified the query - still getting token error: SELECT "T16.CPRP".CP_TOWNSHIP, "T16.CBL".CB_INTEREST_CITY ("T16.CBL".CB_TAX_COLLEC_TD * .03) "T16.CBL".CL_TAX_COLLEC_TD sub (Interest, "T16.CBL".CB_TAX_COLLEC_TD) AS TOTAL, SUM ("T16.CTDT".TD_DETAIL_AMT_01) as Payments FROM QS36F."T16.CPRP" AS "T16.CPRP", QS36F."T16.CBL" AS "T16.CBL", QS36F."T16.CTDT" AS "T16.CTDT" WHERE "T16.CPRP".CP_YEAR = “T16.CBL”.CB_YEAR AND “T16.CPRP”.CP_TAXBILL_NO = “T16.CBL”.CB_TAXBILL_NO AND “T16.CPRP.CP_ROLL_TYPE = “T16.CBL”.CB_ROLL_TYPE AND “T16.CBL”.CB_YEAR = “T16.CTDT”.TD_YEAR AND “T16.CBL_TAXBILL_NO = “T16.CTDT”.TD_TAXBILL_NO AND “T16.CBL”.CB_ROLL_TYPE = “T16.CTDT”.TD_ROLL_TYPE GROUP BY “T16.CPRP”.CP_TOWNSHIP, "T16.CBL".CB_INTEREST_CITY; Thanks again
    365 pointsBadges:
    report
  • philpl1jb
    not minus, not sub just the minus isgn - add with the +, multiply with the * and divide with the / provide the columns are numeric. ................... SELECT “T16.CPRP”.CP_TOWNSHIP, “T16.CBL”.CB_INTEREST_CITY - (”T16.CBL”.CB_TAX_COLLEC_TD * .03) as Interest, “T16.CBL”.CB_TAX_COLLEC_TD) AS TOTAL, SUM (”T16.CTDT”.TD_DETAIL_AMT_01) as Payments FROM QS36F.”T16.CPRP” AS “T16.CPRP”, QS36F.”T16.CBL” AS “T16.CBL”, QS36F.”T16.CTDT” AS “T16.CTDT” WHERE “T16.CPRP”.CP_YEAR = “T16.CBL”.CB_YEAR AND “T16.CPRP”.CP_TAXBILL_NO = “T16.CBL”.CB_TAXBILL_NO AND “T16.CPRP.CP_ROLL_TYPE = “T16.CBL”.CB_ROLL_TYPE AND “T16.CBL”.CB_YEAR = “T16.CTDT”.TD_YEAR AND “T16.CBL_TAXBILL_NO = “T16.CTDT”.TD_TAXBILL_NO AND “T16.CBL”.CB_ROLL_TYPE = “T16.CTDT”.TD_ROLL_TYPE GROUP BY “T16.CPRP”.CP_TOWNSHIP, “T16.CBL”.CB_INTEREST_CITY
    50,860 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following