By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,073 Members | 1,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,073 IT Pros & Developers. It's quick & easy.

Computed Query Field

P: n/a
QUESTION:
In an Access 2000 Query, can a computed field use IF logic?

I have two fields that must be logically concatenated. Only one or the
other will contain real data, but if it is empty then its value will be
"--". I would like to be able to say:

MyField: If ([Field1]="--") then [Field2] else [Field1];

In Excel, I could say:

=IF(Field1="--",Field2,Field1)

Any help would be greatly appreciated.

Dave
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"David McCulloch" <|@|.|> wrote in message
news:8x*****************@twister.rdc-kc.rr.com...
QUESTION:
In an Access 2000 Query, can a computed field use IF logic?

I have two fields that must be logically concatenated. Only one or the
other will contain real data, but if it is empty then its value will be
"--". I would like to be able to say:

MyField: If ([Field1]="--") then [Field2] else [Field1];

In Excel, I could say:

=IF(Field1="--",Field2,Field1)


=IIf(Field1="--", Field2, Field1)
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
Rick,
Thanks. That's exactly what I needed to know and it worked great!

Dave

"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:2h************@uni-berlin.de...
"David McCulloch" <|@|.|> wrote in message
news:8x*****************@twister.rdc-kc.rr.com...
QUESTION:
In an Access 2000 Query, can a computed field use IF logic?

I have two fields that must be logically concatenated. Only one or the
other will contain real data, but if it is empty then its value will be
"--". I would like to be able to say:

MyField: If ([Field1]="--") then [Field2] else [Field1];

In Excel, I could say:

=IF(Field1="--",Field2,Field1)


=IIf(Field1="--", Field2, Field1)
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.