copperwasher
Board Regular
- Joined
- Mar 1, 2016
- Messages
- 84
- Office Version
- 365
- Platform
- Windows
I have a simple designed Access Database, but I have a challenge.
I need to create an expression that can provide an answer based upon the select of Buy or Sell column…
The Expression used in the 'difference column'
[Current Price]-[Price Entry]
If Buy is selected, the calc (in the difference column) should be [Current Price]-[Price Entry]
If Sell is selected, the calc should be [Price Entry]- [Current Price]
But how do I write the expression in the expression builder, so it uses the right calc for a Buy or Sell trade ?
The table should work as below...
Currently the sell trade calc is wrong and working the same as a buy trade
Any guidance is greatly appreciated
CW
I need to create an expression that can provide an answer based upon the select of Buy or Sell column…
The Expression used in the 'difference column'
[Current Price]-[Price Entry]
If Buy is selected, the calc (in the difference column) should be [Current Price]-[Price Entry]
If Sell is selected, the calc should be [Price Entry]- [Current Price]
But how do I write the expression in the expression builder, so it uses the right calc for a Buy or Sell trade ?
The table should work as below...
Currently the sell trade calc is wrong and working the same as a buy trade
Buy/Sell | price entry | current price | Difference | winning/losing |
Buy | 1.00200 | 1.00300 | 0.00100 | Winning |
Buy | 1.00200 | 1.00100 | -0.00100 | Losing |
Buy/Sell | price entry | current price | difference | winning/losing |
Sell | 1.00200 | 1.00100 | 0.00100 | Winning |
Sell | 1.00200 | 1.00300 | -0.00100 | Losing |
Any guidance is greatly appreciated
CW