• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • 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 Access MVP)Database ArchitectCommented:
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
 
LucasMS Dynamics DeveloperAuthor Commented:
That's what i was looking for.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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