Additional query fields

mattmlm

New member
Local time
Today, 22:58
Joined
Jan 5, 2005
Messages
7
Ok,

I have a query that pulls data from various tables, what I want to be able to do is when the query is displayed, add an additional field to the end of the result based on information stored in other fields.

E.g.

Query field headings:
Name, Favourite Number, Favourite Colour, Show me, “5th column result”

The 5th column needs to do the calculation e.g.:
if [Show me] = “yes” then equal “[Name] [Favourite Number]+5 [Favourite Colour]”

So with some data:
Name, Favourite Number, Favourite Colour, Show me, “5th column result”
Dave, 10, Blue, Yes, Dave 15 Blue,
Mark, 4, Yellow, No,,

Sounds easy but I can’t get me head round it!

Many thanks in advance

Matt
 
try

iif([show me] is true, "[Name] & [Favourite Number] & [Favourite Color]")

by the way i would suggest you to rename your field "Name" ... it is not wise using that fieldname for a field, use FirstName for example.
 
Worked :-)

Yep, worked like a dream! Many thanks!

Yes didn’t use ‘Name’ as my field name either it was just for an example ;-)

Cheers

Matt
 
you're welcome, i'm glad that you managed to sort it out.
 

Users who are viewing this thread

Back
Top Bottom