A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Formatting a Number in a Query Field



 
 
Thread Tools Display Modes
  #1  
Old July 4th, 2008, 06:47 PM posted to microsoft.public.access.queries
Brad[_6_]
external usenet poster
 
Posts: 8
Default Formatting a Number in a Query Field

All,

I have a field value that is formatted currency. I need to format the field
in a query to have leading zeros and retain the decimal values without the
decimal.

Example: Field A= 137.19 I need to convert it to 0013719.

I've attempted to convert it to a string and format it to"0000000", but that
just rounded the number and did not retain the decimal values.

I've also tried using the FormatNumber and Val functions without success.

Any guidance you could give me would be greatly appreciated.

Thanks in advance.


  #2  
Old July 4th, 2008, 07:01 PM posted to microsoft.public.access.queries
fredg
external usenet poster
 
Posts: 4,386
Default Formatting a Number in a Query Field

On Fri, 4 Jul 2008 10:47:54 -0700, Brad wrote:

All,

I have a field value that is formatted currency. I need to format the field
in a query to have leading zeros and retain the decimal values without the
decimal.

Example: Field A= 137.19 I need to convert it to 0013719.

I've attempted to convert it to a string and format it to"0000000", but that
just rounded the number and did not retain the decimal values.

I've also tried using the FormatNumber and Val functions without success.

Any guidance you could give me would be greatly appreciated.

Thanks in advance.


NewColumn:Format([NumberField]*100,"0000000")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old July 4th, 2008, 07:20 PM posted to microsoft.public.access.queries
Brad[_6_]
external usenet poster
 
Posts: 8
Default Formatting a Number in a Query Field

Fredg,

Thank you, so simple a solution I completely over looked it.

Thanks, again!


"fredg" wrote in message
.. .
On Fri, 4 Jul 2008 10:47:54 -0700, Brad wrote:

All,

I have a field value that is formatted currency. I need to format the
field
in a query to have leading zeros and retain the decimal values without
the
decimal.

Example: Field A= 137.19 I need to convert it to 0013719.

I've attempted to convert it to a string and format it to"0000000", but
that
just rounded the number and did not retain the decimal values.

I've also tried using the FormatNumber and Val functions without success.

Any guidance you could give me would be greatly appreciated.

Thanks in advance.


NewColumn:Format([NumberField]*100,"0000000")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.