• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

display a formula in a query field

Experts,

i would like to display a formula in my field, kind of like what excel shows in the formula field, but i want it to be displayed in a query field.

So let say i have in excel:
=25000 - 17 - 600

i want to show this in my query:

Formula
----------------------
25000 - 17 - 600

my field names that hold these values are: soldfor - fedex - crating


0
Lucas
Asked:
Lucas
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Example"

SELECT Table1.FIELD1, Table1.FIELD2, Table1.FIELD3, Nz([soldfor],0)-Nz([fedex],0)-nz([crating],0) AS MyFormula
FROM Table1;


mx
0
 
danishaniCommented:
= [soldfor] & " - " & [fedex] & " - " & [crating]

HTH,
Daniel
0
 
LucasAuthor Commented:
That's what i was looking for.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"but i want it to be displayed in a query field."
lucas911
The answer you Accepted does *not* work in a Query field, which is clearly what you stated, and why I posted as such.  The answer you accepted only works as an Expression in a Text box on a Form.

And if you are not wanting to do the Math, then you would use this:

SELECT Table1.FIELD1, Table1.FIELD2, Table1.FIELD3, [soldfor] & "-" & [fedex] & "-" & [crating] AS MyFormula
FROM Table1;


mx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now