field based on field

K

Kou Vang

I feel like I've asked this before. How do I make a field based on another
field in the same query?

exp1=a+b

exp2=val(expr1)

How do I write expr2?

Kou
 
F

fredg

I feel like I've asked this before. How do I make a field based on another
field in the same query?

exp1=a+b

exp2=val(expr1)

How do I write expr2?

Kou

Your above question can have more than one result depending upon field
datatype and what you mean by using the "+".
Did you want to concatenate or add?
Since your Exp2 refers to Val() I would have to assume that a and b
are text datatypes.

Let's assume a = 3 and b = 5

If a and b are Text datatypes
Exp1:"3" + "5"
the result is text "35"

Exp2:Val("3" + "5")
the result is the number 35

However, if a and b are Number datatypes
Exp1:3 + 5
the result is 8

Exp2 is not needed.

Best I can do for you with the information you have given.
 
K

Kou Vang

a+b is just an example. The key is, how do I write expr2 using expr1. My
numeric expression is too complex, therefore I'm breaking it down into 2
seperate expressions. So I need to reference one field in another.

Kou
 

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