Tom said:
SteveB said:
How do I add a field to a query and how can I insert an if statement that
would be something like this:
IF Field1="K" , (True) =1, (False) =0
Thanks for your help.
Make calculated field with this record source:
=IIf([Field1]="K", 1, 0)
Tom Lake
A couple of things I'd add:
1) A great way of finding out about these functions and how to use them
is to get familiar with the "Expression Builder" (Google for loads of
references, including videos). It helps you get the syntax right, both
of the functions and of the various bits and bobs of your database (e.g.
a control on a subform somewhere). One tip: if you click on a function
it often comes up with "<<Expr>>" - this denotes something you have to
replace: it's a common stumble to leave these placeholders in situ
(which throws up errors).
2) Just comparing the field to a constant might not be enough. You may
need to use other Text functions to make sure you TRIM off any spaces,
or pick only the LEFT-most character - unless you can be certain that
every record (present and future) will contain only one character in
this field.
Phil, London