Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to replace a result woth Asterisk 1

Status
Not open for further replies.

report2000

Technical User
Mar 1, 2005
45
US
Hi,
Please Help - Thanks

Problem # 1
I am using access 2003 as my database.
I have a currency field with numeric values including 0
I created one extra column in access and set the data type to (YES/NO). I replaced the values in YES/NO column to "YES" if the value in currency field is equal to zero.
The problem that I have is that when I bring the field currency to my report the number is shown as ($2000) and there is null value for the zeros since I changed the zeros to null and flag it in my newly created column as YES/NO.
IF I used the following formula I get the asterisk and the numbers but the number looks like this ($2000.00). (In access I set the data for the currency field to not have any decimal place)

Problem # 2
After I figure out how to solve the above problem I need to divide the results to 100 by writing another formula to get a (%). How can I divide (*) to lets say 2000 without getting an error.

---------------------------------
if {3_Year_History_of_Base_Salary.Wtd Avg 03 Asterisk}= true
then '*'
else
totext ({3_Year_History_of_Base_Salary.Wtd Avg Hourly Rate 2003})
-----------------------------------------------------------

Best regards,
 
Try:

if {3_Year_History_of_Base_Salary.Wtd Avg 03 Asterisk}= true
then '*'
else
totext ({3_Year_History_of_Base_Salary.Wtd Avg Hourly Rate 2003},0,"")

The zero is the condition setting the decimals to "0" and the "" removes the comma divider.

You should be able to use something like the following:

val({@yourformula}) % sum({table.amt})

...which would return a 0 when an asterisk was present. You could then format the field to "Suppress if zero" if you wanted the field to appear blank.

-LB
 
Thank you very much.
Regarding the formula I would like the formula return '*' and not zero.

One more thing.
How can I modify the formula in order to place a "$" in fornt of "totext ({3_Year_History_of_Base_Salary.Wtd Avg Hourly Rate 2003},0,"")" result?
 
if {3_Year_History_of_Base_Salary.Wtd Avg 03 Asterisk}= true
then '*'
else
"$" + totext ({3_Year_History_of_Base_Salary.Wtd Avg Hourly Rate 2003},0,"")

Are you saying that you want your percentage result ALSO to be an asterisk if an asterisk is in the first formula?

Then use a second formula like:

if {@yourformula} = "*" then "*" else
val({@yourformula}) % sum({table.amt})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top