Calculation and Converting Yes/No to integer. (1 Viewer)

S

sft008

Guest
Hello, I am a newbie to this so here goes..

I have a Boolean Yes/No Value in a report.
It print out on the report -1 for yes, 0 for no.

I want to write a line something similar to the following
(Total = (subtotal * .06) if Tax = Yes) else
(Total = subtotal if Tax = No)

Can someone help... I have been pulling my hair out. I tried to operate on the YES/NO with ABS, CInt etc... I get an error. I just need to convert YES/NO to a 1 or a 0 then I can do the rest... Thanks for any help or suggestion.

Thanks
Frank
 

pcs

Registered User.
Local time
Today, 15:09
Joined
May 19, 2001
Messages
398
you don't need to convert it...test it
for 0 or -1

like:
If [Tax] = -1
If [Tax] = 0

hth
al
 

charityg

Registered User.
Local time
Today, 21:09
Joined
Apr 17, 2001
Messages
634
Or for the control source of the field

IIf([tax]=-1, .06*[subtotal], [subtotal])
 

Chris RR

Registered User.
Local time
Today, 15:09
Joined
Mar 2, 2000
Messages
354
Or use the constants True and False. Much easier to remember:

If [Tax] = True then
'calc tax
else
If [Tax] = False then
'you do not live around here...
 

Users who are viewing this thread

Top Bottom