Hi all,
I am new to the forum and also Access novice. I will appreciate very much if someone can help me solve my access problem, I have been trying to find the solution for few days and I finally decided to ask.
I need to subtract one column from another but there are many nulls which I need them as flags. Here is an example:
ID....value1..... value2...... value3
1......608....... null...........500
2......550....... 537.......... 528
3......617....... null........... null
4......698....... 620........... null
The values decrease from filed "value 1" to field "value 3". So I need to subtract Value 2 ( if is not null) from Value 1 and Value 3 (If is not null) from value 2 BUT if value 2 is null than subtract it from Value 1.
In summary I just need the differences between the fields that are not null. If the field is null subtract from next one and so on until you get a not null field.
The differences do not have to be in one column but in 3 in this example. It sounds complicated, I tried using IIf statement but it gets to complicated and there was not enough space to write the whole conditional statement as I have 11 columns to subtract from each other. Can somebody give me any idea of how to solve this and if I need to use SQL how to write it?
Thanks, I appreciate your help
I am new to the forum and also Access novice. I will appreciate very much if someone can help me solve my access problem, I have been trying to find the solution for few days and I finally decided to ask.
I need to subtract one column from another but there are many nulls which I need them as flags. Here is an example:
ID....value1..... value2...... value3
1......608....... null...........500
2......550....... 537.......... 528
3......617....... null........... null
4......698....... 620........... null
The values decrease from filed "value 1" to field "value 3". So I need to subtract Value 2 ( if is not null) from Value 1 and Value 3 (If is not null) from value 2 BUT if value 2 is null than subtract it from Value 1.
In summary I just need the differences between the fields that are not null. If the field is null subtract from next one and so on until you get a not null field.
The differences do not have to be in one column but in 3 in this example. It sounds complicated, I tried using IIf statement but it gets to complicated and there was not enough space to write the whole conditional statement as I have 11 columns to subtract from each other. Can somebody give me any idea of how to solve this and if I need to use SQL how to write it?
Thanks, I appreciate your help
Last edited: