Project Function help

S

sdc

Hi,

I need some help in using a project function. I am currently evaluating a
number value with the following equation:

(DateValue([Date9])-DateValue([Date7]))/(DateValue([Date8])-DateValue([Date6])

If this returns a value of 0, I (of course) receive an "#ERROR" in the
column. What is the proper way to write a function that will enter a "NA" in
the column if the above equation value is equal to "#ERROR".

Thank you SO much for your help!
sdc
 
D

Dave

You can't display NA in a number field. I suggest that you convert the
ratio to a string and display it in a text field. Then you can add a
test for the quotient being zero and display NA.

Iif( [Date8]=[Date6] , 'NA' , str( ( DateValue( [Date9]) - DateValue(
[Date7] ) ) / (DateValue( [Date8] ) - DateValue( [Date6] ) ) ) )
 
S

sdc

Thank you Dave - this worked great. HOWEVER, now I have one more request for
help for this same equation. This is the current equation to get the result
I need:

Left(IIf([Date8]=[Date6],'NA',str((DateValue([Date9])-DateValue([Date7]))/(DateValue([Date8])-DateValue([Date6])))),5)


The problem is that sometimes, the data for the [Date7] has not been entered
yet therefore resulting in an '#ERROR' returned from the above equation. How
can I further modify this equation so that if [Date7] = 'NA' then return a
value of 'NA'. (I tried doing this with an IIf equation, but I kept getting
an error message :((

Thank you again SO much!
Your help is very much appreciated!
sdc
Dave said:
You can't display NA in a number field. I suggest that you convert the
ratio to a string and display it in a text field. Then you can add a
test for the quotient being zero and display NA.

Iif( [Date8]=[Date6] , 'NA' , str( ( DateValue( [Date9]) - DateValue(
[Date7] ) ) / (DateValue( [Date8] ) - DateValue( [Date6] ) ) ) )
Hi,

I need some help in using a project function. I am currently evaluating a
number value with the following equation:

(DateValue([Date9])-DateValue([Date7]))/(DateValue([Date8])-DateValue([Date6])

If this returns a value of 0, I (of course) receive an "#ERROR" in the
column. What is the proper way to write a function that will enter a "NA" in
the column if the above equation value is equal to "#ERROR".

Thank you SO much for your help!
sdc
 
S

sdc

Hey - I just figured it out. Thank you for your help!
sdc

sdc said:
Thank you Dave - this worked great. HOWEVER, now I have one more request for
help for this same equation. This is the current equation to get the result
I need:

Left(IIf([Date8]=[Date6],'NA',str((DateValue([Date9])-DateValue([Date7]))/(DateValue([Date8])-DateValue([Date6])))),5)


The problem is that sometimes, the data for the [Date7] has not been entered
yet therefore resulting in an '#ERROR' returned from the above equation. How
can I further modify this equation so that if [Date7] = 'NA' then return a
value of 'NA'. (I tried doing this with an IIf equation, but I kept getting
an error message :((

Thank you again SO much!
Your help is very much appreciated!
sdc
Dave said:
You can't display NA in a number field. I suggest that you convert the
ratio to a string and display it in a text field. Then you can add a
test for the quotient being zero and display NA.

Iif( [Date8]=[Date6] , 'NA' , str( ( DateValue( [Date9]) - DateValue(
[Date7] ) ) / (DateValue( [Date8] ) - DateValue( [Date6] ) ) ) )
Hi,

I need some help in using a project function. I am currently evaluating a
number value with the following equation:

(DateValue([Date9])-DateValue([Date7]))/(DateValue([Date8])-DateValue([Date6])

If this returns a value of 0, I (of course) receive an "#ERROR" in the
column. What is the proper way to write a function that will enter a "NA" in
the column if the above equation value is equal to "#ERROR".

Thank you SO much for your help!
sdc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top