Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:28:21+00:00 2026-05-29T19:28:21+00:00

please help me, I got the Join Predicate not valid error for the below

  • 0

please help me, I got the Join Predicate not valid error for the below sql, it will be very messy but please help me if you can. Thanks in advance.

SELECT department.eaaitm, 
       RIGHT(LEFT(egacdt, 6), 2), 
       SUM(CASE department.eaaitm 
             WHEN '912' THEN egacam / 2 
             ELSE egacam 
           END) AS suma, 
       SUM(CASE department.eaaitm 
             WHEN '700' THEN CASE data.eaaicl 
                               WHEN '400' THEN -egacam 
                               WHEN '402' THEN -egacam 
                               WHEN '404' THEN -egacam 
                               ELSE egacam 
                             END 
             WHEN '912' THEN egacam / 2 
             ELSE egacam 
           END / cuarat) 
FROM   mvxcdtpusd.fchacc department, 
       mvxcdtpusd.fchacc data 
       LEFT JOIN mvxcdtpusd.fgledg 
         ON data.eaaitm = egait1 
            AND data.eacono = 888 
            AND data.eaaitp = 1 
            AND egcono = 888 
            AND ( egdivi = ? 
                  AND ( data.eadivi = ? 
                         OR data.eadivi = '' ) ) 
            AND ( egdivi = ? 
                  AND ( department.eadivi = ? 
                         OR department.eadivi = '' ) ) 
            AND egacdt >= ? 
            AND egacdt <= ? 
       JOIN mvxcdtpusd.ccurra 
         ON ( cudivi = ( CASE egdivi 
                           WHEN '300' THEN egdivi 
                           ELSE '100' 
                         END ) 
              AND cucucd = 'USD' 
              AND LEFT(cucutd, 6) = LEFT(egacdt, 6) 
              AND ( ( cudivi = '300' 
                      AND cucrtp = '50' ) 
                     OR ( cudivi <> '300' 
                          AND culocd = 'USD' 
                          AND cucrtp = '1' ) ) 
              AND RIGHT(cucutd, 2) = '01' ) 
WHERE  egait3 = department.eaaitm 
       AND department.ealccd IN ( 0, 1 ) 
       AND department.eacono = 888 
       AND department.eaaitp = 3 
       AND data.eaaicl >= '400' 
       AND ( department.eaaitm IN ( '000' ) 
              OR department.eaaitm IN ( '912' ) 
                 AND data.eaaitm NOT IN ( '5707310' ) 
              OR department.eaaitm IN ( '914', '808' ) 
                 AND data.eaaitm NOT IN ( '5707310' ) ) 
GROUP  BY department.eaaitm, 
          RIGHT(LEFT(egacdt, 6), 2) 
ORDER  BY department.eaaitm, 
          RIGHT(LEFT(egacdt, 6), 2) 

———————————– Ans:———————————–
i have solved already. Thanks All

 SELECT department.eaaitm,
       RIGHT(LEFT(egacdt, 6), 2),
       SUM(CASE department.eaaitm
             WHEN '912' THEN egacam / 2
             ELSE egacam
           END) AS suma,
       SUM(CASE department.eaaitm
             WHEN '700' THEN CASE data.eaaicl
                               WHEN '400' THEN -egacam
                               WHEN '402' THEN -egacam
                               WHEN '404' THEN -egacam
                               ELSE egacam
                             END
             WHEN '912' THEN egacam / 2
             ELSE egacam
           END / cuarat)
FROM   mvxcdtpusd.fchacc department,
       mvxcdtpusd.fchacc data
       LEFT JOIN mvxcdtpusd.fgledg
         ON data.eaaitm = egait1
            AND data.eacono = 888
            AND data.eaaitp = 1
            AND egcono = 888
            AND ( egdivi = 100
                  AND ( data.eadivi = 100
                         OR data.eadivi = '' ) )
            AND egacdt >= 20120101
            AND egacdt <= 20120131
       JOIN mvxcdtpusd.ccurra
         ON ( cudivi = ( CASE egdivi
                           WHEN '300' THEN egdivi
                           ELSE '100'
                         END )
              AND cucucd = 'USD'
              AND LEFT(cucutd, 6) = LEFT(egacdt, 6)
              AND ( ( cudivi = '300'
                      AND cucrtp = '50' )
                     OR ( cudivi <> '300'
                          AND culocd = 'USD'
                          AND cucrtp = '1' ) )
              AND RIGHT(cucutd, 2) = '01' )
WHERE  egait3 = department.eaaitm
       AND department.ealccd IN ( 0, 1 )
       AND department.eacono = 888
       AND department.eaaitp = 3
       AND data.eaaicl >= '400'
       AND ( department.eaaitm IN ( '000' )
              OR department.eaaitm IN ( '912' )
                 AND data.eaaitm NOT IN ( '5707310' )
              OR department.eaaitm IN ( '914', '808' )
                 AND data.eaaitm NOT IN ( '5707310' ) )
       AND ( egdivi = 100
             AND ( department.eadivi = 100
                    OR department.eadivi = '' ) )
GROUP  BY department.eaaitm,
          RIGHT(LEFT(egacdt, 6), 2)
ORDER  BY department.eaaitm,
          RIGHT(LEFT(egacdt, 6), 2)  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:28:23+00:00Added an answer on May 29, 2026 at 7:28 pm

    I’m not sure what system you are using to pass parameters to your query but I imagine it replaces the question marks (?) shown below

    AND ( egdivi = ? 
                  AND ( data.eadivi = ? 
                         OR data.eadivi = '' ) ) 
            AND ( egdivi = ? 
                  AND ( department.eadivi = ? 
                         OR department.eadivi = '' ) ) 
            AND egacdt >= ? 
            AND egacdt <= ? 
    

    In any case the error you are getting is because one of those is not right. Please show how you are passing parameters to this query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please help, I got the code below from a book but it doesnt seem
I could not make a better title, if anyone can do it please, help
Can anyone please help me with this? I've got a .jar file for which
Hey Hi Friends I got exception in my method... please help me error like
everyone, I got a strange problem, please help. the error message is: Run-time error
Can you please help me? I got stuck! I implemented a single table inheritance
Please help! Background info I have a WPF application which accesses a SQL Server
Please help, I got this code from googling on how to use mysql dump
I am learning WF4 and got stuck at the following place. Please help.Thanks. 1)
Please help me to write the following sql. I have a table like this,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.