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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write multiple conditions

Status
Not open for further replies.

abc567

Programmer
Jul 8, 2009
45
US
Hi,

I am required to write a condition like,

NumberVar df= Datediff('d',Field1, Field2);

if
(
0 < df <=50
)

then
1
else
0


But i am unable to write it in formula..

 
Try a formula field with
Code:
Datediff('d',Field1, Field2)
Then another with
Code:
If @Diff <=50
then 1
else 0
For most purposes, formula fields are easier than variables.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
I would change that last formula to:

If {@Diff} >= 0 and
{@Diff} <= 50 then
1 else 0

Make sure you have syntax set to Crystal syntax (above the formula area).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top