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!

Assistance with displaying records only if a certain condition is met

Status
Not open for further replies.

izenger

IS-IT--Management
Sep 23, 2013
5
0
0
US
Hello,

I'm needing assistance with a way to only display records if a certain condition is met for the 2nd table that I'm pulling data from. I have a database that I'm connecting to via ODBC. I'm trying to run a report that looks at 2 tables. The 2 tables are linked by a field called number. The 2nd table has multiple entries for each number for different statuses.

Here's an example of what I'm talking about:

Table A
Number
Field
Etc.

Table B
Number
Status
Person
Date/Time

For every record in Table A, there can be up to 10 records in Table B depending on how many status changes there were to that record in Table A differentiated by the Date/Time stamp. Table B is tied to Table A by the number field.

What I'm trying to figure out is how do I display {A.Number} if and only if {B.Status} does not have a specific status in it.

I apologize if my question comes across as fuzzy; been working on this today and haven't been able to come up with a good solution.

Any help would be appreciated.

Thanks,

Isaac
 
Assuming I understand what you are trying to do, one way to do it would be as follows:

[ol 1]
[li]Create a Group on {TableA.Number}[/li]
[li]Create the following Formula:
[Code {@Status}]
If {TableB.Status} = "Selected Status"
Then 0
Else 1
[/Code]
, where "Selected Status" is the status you want reported when it does not exist
[/li]
[li]Create the following Group Selection formula
[Code Group_Selection_Formula]
Minimum({@Status}, {TableA.Number}) = 1
[/Code]
[/li]
[/ol]

Hope this helps

Cheers\Pete
 
Thanks a ton for your suggestion, worked great!

My problem was that I was completely overthinking the solution. I was trying to put all of the statuses in {TableB.Status} in an array, then checking that array if my status I wanted to search by was not in that array.

Isaac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top