Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ian who helped me before pulling things Date change in last full month

Status
Not open for further replies.

tcbc

Technical User
Feb 7, 2009
33
US
{group_detail.location} in ["MAIN"] and
{master_cred.active} = "P" and
{master_cred.med_staff_status} = "PCP" and
(({master_cred.status} in ["ACTIVE", "part", "hold", "PRAC"] or
({log_column.initial_value}in ["ACTIVE", "PART", "HOLD", "PRAC"] and
{log_column.final_value} = "inactive" and
{log_column.log_date} in lastfullmonth)))

Here is what I came up with but the last OR statement that follows is not bringing up Those made inactive in the last month. Can you tell why the last part of this statement is not pulling. Are my parenthesis out of whack?

({log_column.initial_value}in ["ACTIVE", "PART", "HOLD", "PRAC"] and
{log_column.final_value} = "inactive" and
{log_column.log_date} in lastfullmonth)))

 
The parens look OK ( Try formatting them fpr easy reading:

Code:
{group_detail.location} in ["MAIN"]
 and
{master_cred.active} = "P" 
 and
{master_cred.med_staff_status} = "PCP" 
 and
( [COLOR=green]//first parens in AND clause[/color]
 ( [COLOR=green]//second parens in AND clause[/color]
{master_cred.status} in ["ACTIVE", "part", "hold", "PRAC"] 

or

( [COLOR=green]//first parens in OR clause[/color]
{log_column.initial_value}in ["ACTIVE", "PART", "HOLD", "PRAC"] 
and
{log_column.final_value} = "inactive" 
and
{log_column.log_date} in lastfullmonth
)[COLOR=green]//CLOSE first parens in OR clause[/color]

)[COLOR=green]//CLOSE second parens in AND clause[/color]

)[COLOR=green]//CLOSE first parens in AND clause[/color]



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
You should not really address posts to anyone in particular.

As Turkbear says your Parens are OK. But you have mixed case strings try removing any doubt by converting all to uppercase eg

uppercase({group_detail.location}) in ["MAIN"] and
{master_cred.active} = "P" and
{master_cred.med_staff_status} = "PCP" and
((uppercase({master_cred.status}) in ["ACTIVE", "PART", "HOLD", "PRAC"] or
(uppercase({log_column.initial_value})in ["ACTIVE", "PART", "HOLD", "PRAC"] and
uppercase({log_column.final_value}) = "INACTIVE" and
{log_column.log_date} in lastfullmonth)))


Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top