Databasejoin element - Data where condition

Status
Not open for further replies.

stevelis

Member
Looking for the correct condition to filter my calendar___steward4 which is databasejoin dropdown element.
The databasejoin is from the steward List which has the following field elements FName, LName and a dropdown element Region.
There is a Concat Label for FName, LName which is working and provides a full name for the calendar___steward4 element
What I am trying to achieve is when an allocation officer logs in, the list of full names which are displayed in the dropdown of the Calendar___steward4 are only those with the same Region value as the allocation officer.
The steward List also has a Yes No element called active
I have had no luck with this one
WHERE {thistable}.`steward4`IN ( SELECT Region FROM steward WHERE Region = ($my->Region} AND {thistable}.active =1)

Thanks
Steve
 
The following is achieving the desired result by including the region value.
where {thistable}.Region IN(SELECT Region FROM steward WHERE Region ='QLD' AND {thistable}.active =1)
However, there are about 7 different values associated with the Region element, hence my need to condition based on the logged in user's region value.

Steve
 
In my situation the following condition is working fine
where {thistable}.Region IN(SELECT Region FROM steward WHERE J_id = '{$my->id}' AND {thistable}.active =1)

Steve
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top