If statement 
Author Message
 If statement

Hi All,
This seems so simple but, I am having trouble with the syntax.
I have a table column named {SaleInvTable.Df1}. It is a currency value.
I have a formula named "northing" and all it is is an empty string.
What I want to do is as follows:
If {SaleInvTable.Df1} < 1 then I want the value  to be an empty string (my
"nothing" formula). Otherwise I want the value to be {SaleInvTable.Df1}.
I tried the following:
if {SaleInvTable.Df1} < 1 then
    "nothing"
else
    {SaleInvTable.Df1} *** Message says a string is required here.

VS 2003, VB.NET and the Crystal that ships with VS 2003.
Thanks for your help,
Roy



Sat, 10 Dec 2005 00:32:39 GMT  
 If statement

Quote:

> If {SaleInvTable.Df1} < 1 then I want the value  to be an empty string (my
> "nothing" formula). Otherwise I want the value to be {SaleInvTable.Df1}.
> I tried the following:
> if {SaleInvTable.Df1} < 1 then
>     "nothing"
> else
>     {SaleInvTable.Df1} *** Message says a string is required here.

use
else
  totext({SaleInvTable.Df1})

Crystal check if all the results are of the same type. So you can't mix a
number and a string. That what you was trying.
You could also use
if {...} < 1 then 0 else {...}
And make the filed non-displaying for zero values.



Sat, 10 Dec 2005 02:06:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Expected:line number or label or statement or end of statement

2. running sql code record by record instead of statement by statement

3. With...End With statement bombing out in For...Next statement

4. Very simple - How to execute sub statements before the end statement

5. Combine a Loop Statement and If Statement?

6. Update statement creates Error, when statement is fine

7. db.execute <sql statement> vs docmd..runsql <sql statement>

8. how to get through a Sql Statement data from a MDB with a date field as "where" statement

9. Can you help convert IF Statement to a Select Case Statement?

10. HELP!!! Doing multiple statements on IF THEN Statements??

11. IF statement and tables in VBA

12. DoCmd and Update statement

 

 
Powered by phpBB® Forum Software