×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Why query result not as currency
2

Why query result not as currency

Why query result not as currency

(OP)
Hello I have a query called qryMAIN. In this query I have the following calculated field:

CODE -->

Trans_OUT_Calc_VAT_Amount: Format(([Trans_Out_Gross_Amt]/(100+[Trans_VAT_Rate]))*([Trans_VAT_Rate]),"Currency") 

This seesm to work OK and presents the field data in a currency format. i.e. if I introduce the criteria >0 its fine.

If I then go to use qryMain as the underlying source to create a further query, if I use this field [Trans_OUT_Calc_VAT_Amount] then it seems to present it as a text field, not currency. For exapmple if I introduce the above criteria is repsresents it as >"0"

Why is the currecny format not maintained - is there a way round this?

Thanks Mark

RE: Why query result not as currency

The Format() function converts your number to text. Why are you setting the format? The format is typically at the point of user interface which should be a form or report.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Why query result not as currency

(OP)
The reason I am using format is to prevent the results from having long decimal places. (i.e. 10.23654578 etc)

I'm trying to calculate VAT tax amaounts, so I need either it to be fixed or as a currency.

Is there a better approach?

Basically I have the Gross Cost and The Tax Rate and need to calculate the net VAT amount: i.e.

Gross amount £200, Tax Rate 20%

Calculation: £200/100+20*20 = £33.33

Thanks Mark

RE: Why query result not as currency

>The reason I am using format

As Duane says, you only really need to do this for display purposes, not in the underlying query. If you want to see it a currency when viewing the query in table view, just set the fields Format property in the query designer.

RE: Why query result not as currency

There are other functions for rounding that maintain the numeric data type.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Why query result not as currency

(OP)
Thank you for this -- I have used the Round function which seems to give the right results.

Many thanks - PS - Is the Round function appropriate or are there better ones?

Mark

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close