Re: how 2 update a tbl field based on result of a math calculation

From: Daniel Allan (DanielAllan_at_discussions.microsoft.com)
Date: 09/07/04


Date: Mon, 6 Sep 2004 21:01:09 -0700

Hi Allen,

Thanks for you suggestion, I created the query as suggested, i am able to
get correct data from the query output into a field called "TotalPrice" in
the query result window, but how do I extract data from the query result
field into my "Sales Register" table? Thanks

Daniel

"Allen Browne" wrote:

> Hi Daniel
>
> Unless there is a reason why the TotalPrice should sometimes be different
> from the calcuation, you must not store it in your table. Instead, use a
> calculated field in query. Then you never have to worry about whether you
> have updated the field correctly or not.
>
> The calculated field is as simple as typing this into the Field row in your
> query:
> TotalPrice: [SalesUnits] * [SalePricePerUnit]
>
> Even better, handle the null and convert the result to currency:
> TotalPrice: CCur(Nz([SalesUnits] * [SalePricePerUnit],0))
>
> For more information, including how to store the calculated result in your
> table if you really need to, see:
> Calculated fields
> at:
> http://members.iinet.net.au/~allenbrowne/casu-14.html
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.



Relevant Pages

  • Re: Else If Statements
    ... are saying I would have first take the select query with the calculated field ... in it and make it into a make table query and then do another select query. ... Within the origional table there is a post code field. ... postcode down to only show the first part of the postcode i.e. the alpha ...
    (microsoft.public.access.queries)
  • RE: Passing variables to Function
    ... Ok here is the calculated field from my query and my primary function. ... add previous cycle totals if they exist. ... be called from the qryReagent1 query. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Else If Statements
    ... I started with a table with about 8 columns in it and then pulled a query ... Within the origional table there is a post code field. ... postcode down to only show the first part of the postcode i.e. the alpha ... What I need to do then is to put another calculated field into the ...
    (microsoft.public.access.queries)
  • Re: User defined function in SQL statement
    ... I'm taking your advice and trying to incorporate the second table in the SQL ... CONVERSION TABLE] AS B ... calculated field for both Existing and Proposed so I had to move the Nz and ... Query works. ...
    (microsoft.public.access.queries)
  • Re: uer
    ... > I'm creating a query in design view. ... > function to create a calculated field. ... > So I type a name for the calculated field "NewFieldName", ...
    (microsoft.public.access.queries)