Simple Criteria question?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Where do I begin?
When a user selects a Plan ID (as a parameter) I need the below results to
show.

Example:

If my field (TR_NO = "35555") then show the results from another field I
have named "TR_Amt". If it does not match the number above then show a "0"
zero value in that field. I have three different fields with different
numbers (I.E TR_NO = 4005 and TR_NO = 37711) and to show the results in 3
different fields (named Dist Fee and Loan FEE).
Any help is appreciated
 
Your statement is not very clear. Here's what I interpret

If TR_NO = "35555", show TR_Amt
If TR_NO = "4005", show DistFee
If TR_NO = "37711", show LoanFee

Is this right?
 
Is this what you want?
SELECT IIf([TR_NO]="35555",[TR_Amt],0) AS Amount, IIf([TR_NO]="4005",[Dist
Fee],0) AS Dist_Fee, IIf([TR_NO]="37711",[Loan FEE],0) AS Loan_Fee
FROM YourTable;

If [TR_NO] is a numerical field then remove the quotes.
 
BINGO! THANKS AGAIN JUST WHAT I NEEDED!

KARL DEWEY said:
Is this what you want?
SELECT IIf([TR_NO]="35555",[TR_Amt],0) AS Amount, IIf([TR_NO]="4005",[Dist
Fee],0) AS Dist_Fee, IIf([TR_NO]="37711",[Loan FEE],0) AS Loan_Fee
FROM YourTable;

If [TR_NO] is a numerical field then remove the quotes.

TKM said:
Where do I begin?
When a user selects a Plan ID (as a parameter) I need the below results to
show.

Example:

If my field (TR_NO = "35555") then show the results from another field I
have named "TR_Amt". If it does not match the number above then show a "0"
zero value in that field. I have three different fields with different
numbers (I.E TR_NO = 4005 and TR_NO = 37711) and to show the results in 3
different fields (named Dist Fee and Loan FEE).
Any help is appreciated
 
Yes pretty much thank you very much!

Bruce Meneghin said:
Your statement is not very clear. Here's what I interpret

If TR_NO = "35555", show TR_Amt
If TR_NO = "4005", show DistFee
If TR_NO = "37711", show LoanFee

Is this right?
 
Karl,

Just after taking a second look I noticed this had some problems. However it
is very, very close. What I need it to do after playing with it is to put a
"0" in the STTR FEE, Dist Fee and Loan Fee if they do not match the assigned
numbers in the TR_NO field. If they do match the numbers then put them in the
approi8ate field as follows.

Field Names

STTR Fee needs amt if it matches (TR_NO 3540)
Dist Fee " " (TR_NO 3553)
Loan Fee " " (TR_NO 3556)

I hope this clarifies this a little bit better. The above field names are
named by me from another field in my table. Such as the original field name
is TR_AMT and I changed it to STTR Fee in the query this way STTR Fee: [tbl
nme].[field name]

Thanks again for your help

KARL DEWEY said:
Is this what you want?
SELECT IIf([TR_NO]="35555",[TR_Amt],0) AS Amount, IIf([TR_NO]="4005",[Dist
Fee],0) AS Dist_Fee, IIf([TR_NO]="37711",[Loan FEE],0) AS Loan_Fee
FROM YourTable;

If [TR_NO] is a numerical field then remove the quotes.

TKM said:
Where do I begin?
When a user selects a Plan ID (as a parameter) I need the below results to
show.

Example:

If my field (TR_NO = "35555") then show the results from another field I
have named "TR_Amt". If it does not match the number above then show a "0"
zero value in that field. I have three different fields with different
numbers (I.E TR_NO = 4005 and TR_NO = 37711) and to show the results in 3
different fields (named Dist Fee and Loan FEE).
Any help is appreciated
 
jUST FIXED IT! Thanks again for getting me started in the right direction!
Take care

KARL DEWEY said:
Is this what you want?
SELECT IIf([TR_NO]="35555",[TR_Amt],0) AS Amount, IIf([TR_NO]="4005",[Dist
Fee],0) AS Dist_Fee, IIf([TR_NO]="37711",[Loan FEE],0) AS Loan_Fee
FROM YourTable;

If [TR_NO] is a numerical field then remove the quotes.

TKM said:
Where do I begin?
When a user selects a Plan ID (as a parameter) I need the below results to
show.

Example:

If my field (TR_NO = "35555") then show the results from another field I
have named "TR_Amt". If it does not match the number above then show a "0"
zero value in that field. I have three different fields with different
numbers (I.E TR_NO = 4005 and TR_NO = 37711) and to show the results in 3
different fields (named Dist Fee and Loan FEE).
Any help is appreciated
 
Back
Top