IF statment (yes/no)

G

Guest

hey guys, hopin someone cld help me...

im tryin to create a report where the "Use" field ,which is a Yes/No format,
shld return "Leave Entitled" when true and "No Leave" when false. I keep
gettin errors when i try the following in the report's textbox under the
field "Use"

=IIf([use]=Yes,"Leave Used","No Leave")
 
G

Guest

If you re-read your post you will find the answer...!

Replace "yes" with TRUE and it should work.
 
G

Guest

Can I ask why you are using a yes/no field to determine leave entitlements ?

If you were to reconfigure the leave entitlements with a number (as in days
leave) you could then simply write your if statements to a numeric value (0 =
no leave, >1 = leave entitled etc etc...)

Then when you are calculating leave entitlements you can use this field, and
you don't have to recheck against any other data to find if they have an
entitlement in the first place - to determine a 'yes' or a 'no' you are
obviously checking this from somewhere else.

Secondly, your naming conventions appear abstract - "use" is ambiguous and
will be very hard for a replacement DBA to work out precicely what you mean.
Renaming it to Emp_Leave_LeaveCredits will make it easier to determine that
you are talking about an employees balance of leave for example.

Mæl.

scubadiver said:
If you re-read your post you will find the answer...!

Replace "yes" with TRUE and it should work.

--
"Loose Change 2nd Edition" has been seen by almost 7 million people on
Google video


John said:
hey guys, hopin someone cld help me...

im tryin to create a report where the "Use" field ,which is a Yes/No format,
shld return "Leave Entitled" when true and "No Leave" when false. I keep
gettin errors when i try the following in the report's textbox under the
field "Use"

=IIf([use]=Yes,"Leave Used","No Leave")
 

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