If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Writing Expressions in Access
This is a simple expression, I just am having issues today. I am trying to
write an expression that show the difference between 2 fields and if the second field is 0 then no total would display. |
#2
|
|||
|
|||
Writing Expressions in Access
iif(nz(Field2) = 0, null, abs(field1 - field2))
Chris Nebinger Casey P wrote: This is a simple expression, I just am having issues today. I am trying to write an expression that show the difference between 2 fields and if the second field is 0 then no total would display. |
#3
|
|||
|
|||
Writing Expressions in Access
iif(nz(Field2) = 0, null, abs(field1 - field2))
Chris Nebinger Casey P wrote: This is a simple expression, I just am having issues today. I am trying to write an expression that show the difference between 2 fields and if the second field is 0 then no total would display. |
#4
|
|||
|
|||
Writing Expressions in Access
OK so this is what I have
= iif(Reviewed Value) = 0, null, ([Complete Date] - [Reviewed Value) I get a Syntax Error " wrote: iif(nz(Field2) = 0, null, abs(field1 - field2)) Chris Nebinger Casey P wrote: This is a simple expression, I just am having issues today. I am trying to write an expression that show the difference between 2 fields and if the second field is 0 then no total would display. |
#5
|
|||
|
|||
Writing Expressions in Access
iif Reviewed value is "0" then Cut Value is "0" otherwise Original Cost -
REviewed Value in Cut Value That is what I trying to write. I can do the subraction expression fine, but I am having a block when it comes the the rest. " wrote: iif(nz(Field2) = 0, null, abs(field1 - field2)) Chris Nebinger Casey P wrote: This is a simple expression, I just am having issues today. I am trying to write an expression that show the difference between 2 fields and if the second field is 0 then no total would display. |
#6
|
|||
|
|||
Writing Expressions in Access
Watch those parentheses and square brackets. They must match up. I think
what you need is: IIF([Reviewed Value] = 0, null, [Complete Date] - [Reviewed Value]) "Casey P" wrote in message ... OK so this is what I have = iif(Reviewed Value) = 0, null, ([Complete Date] - [Reviewed Value) I get a Syntax Error " wrote: iif(nz(Field2) = 0, null, abs(field1 - field2)) Chris Nebinger Casey P wrote: This is a simple expression, I just am having issues today. I am trying to write an expression that show the difference between 2 fields and if the second field is 0 then no total would display. |
#7
|
|||
|
|||
Writing Expressions in Access
Huh, I knew it was something simple. I was leaving the "null" out!
Thanks sir. "John Spencer" wrote: Watch those parentheses and square brackets. They must match up. I think what you need is: IIF([Reviewed Value] = 0, null, [Complete Date] - [Reviewed Value]) "Casey P" wrote in message ... OK so this is what I have = iif(Reviewed Value) = 0, null, ([Complete Date] - [Reviewed Value) I get a Syntax Error " wrote: iif(nz(Field2) = 0, null, abs(field1 - field2)) Chris Nebinger Casey P wrote: This is a simple expression, I just am having issues today. I am trying to write an expression that show the difference between 2 fields and if the second field is 0 then no total would display. |
#8
|
|||
|
|||
Writing Expressions in Access
On Tue, 5 Sep 2006 08:32:01 -0700, Casey P
wrote: OK so this is what I have = iif(Reviewed Value) = 0, null, ([Complete Date] - [Reviewed Value) I get a Syntax Error Count parentheses and square brackets. You have no closing square bracket after Reviewed Value, and you have two left parentheses and only one right parenthesis. They've got to balance! Try = iif(Reviewed Value) = 0, null, ([Complete Date] - [Reviewed Value])) John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|