kc8ufv wrote:The back end is still in Access format, and it would be best to leave it in that format, as we have multiple front ends accessing that back end.
Since, you intend to keep Microsoft Access as your back-end database, you can only use Microsoft Access functions. Therefore, I think you probably will want to use the Access function
IIF that is similar to a spreadsheet
IF statement.
So, perhaps you want your query to look like this:
Code: Select all
SELECT
`Case`,
`Defendant`,
`Surety name`,
`Bond Type`,
IIF(`Bond Type` = 'Cash/Surety/10% Cash', ((`recieved amnt` * (0.9)) - `Fees/Costs Due`), (`recieved amnt` - `Fees/Costs Due`)) AS `Refund`,
`date`,
`recieved amnt`,
`Fees/Costs Due`,
`Refunded`
FROM `Bonds`
WHERE `Surety` = FALSE
AND `Ready4release` = TRUE
AND `Forefieted` = FALSE
AND `Escheated` = FALSE
AND `Refunded` = FALSE
ORDER BY `Case` ASC
Explanation: - I used the Microsoft IIF function.
- The database column names are surrounded the `, like ( `Bond Type` ).
- Text strings are surround by single quotes ' ( like 'Cash/Surety/10% Cash' ) .
- Care must be used to ensure the parentheses match in the IIF statement.
- Please review what I wrote in the IIF statement, to make sure the logic is what you want. I tried to just copy what you wrote, and, change the syntax so Access would accept it. You entered the parentheses, and, I think I kept them as you wanted.
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add
[Solved] in your
1st post Subject (edit button top right) if this issue has been resolved.