Database join "or" whereas clause

User147276
Giga Guru

I am trying to create a database join of 3 out of the box tables - resource_allocation, pm_project and pm_project_task, using the task field on the resource_allocation table as the connection.  The task on a resource_allocation can either be a PRJXXXX (pm_project) or a PRJTASKXXXX (pm_project_task).  I want to write the whereas clause as an "or" statement, so my data set will include resource allocations for BOTH projects and project tasks.  I'm not writing the "or" statement correctly (even though I'm using the || symbol) and hope someone can tell me what I'm doing wrong.  If I only join 2 tables it works fine (resource allocation to project for example), but I only get half the data that I need.  Thank you!

find_real_file.png

5 REPLIES 5

stevenm
Kilo Guru

Don't know if this will help but I recently learned that when joining tables in a db view you have to watch the Order.  Your order values are all 100.  To get it to join correctly you'll want to order the way you want the joins to work say 100, 200, 300.  My joins didn't work properly until I ordered them.  See if it works.

I did try this, but am still getting the same syntax error.  I've also tried using a space in front and behind of the double pipe (or) symbol.

Jordan Rose1
Kilo Expert

I'm pretty sure you need to specify where clauses for each table in your view tables list.  You only have a where clause setup for Resource Allocation.  For example, the pm_project_task where clause would be tsk_sys_id = res_task

Prateek kumar
Mega Sage

Hello tcodell

Try this

Your where clause should be like this:

prjtsk_parent=prj_sys_id

res_task=prj_sys_id

Let me know if you have any issues.

find_real_file.png


Please mark my response as correct and helpful if it helped solved your question.
-Thanks