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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Number formatting
First I just want to think all you smart people that help out on this board.
You've saved my life! Now, here's my problem. The output in my query produces numbers that look like this for example: 2314.89 or -457.95 I need to get them into this format: 0000231489_ (where the _ represents a "blank") and 0000045795- So this field has to be 11 characters long and zero filled at the beginning. The kicker is that if it is a positive number, I need the 11th (far right) column to be blank. If it is a negative number, I need a trailing negative sign in that far right column -- Thanks from a frustrated accountant |
#2
|
|||
|
|||
Mybe you can get a better answer, but you can try this
IIF(MyNum 0, Format(MyNum * -100, "0000000000") & "-" , format(MyNum * 100, "0000000000") & " ") "AccessNewbie" wrote: First I just want to think all you smart people that help out on this board. You've saved my life! Now, here's my problem. The output in my query produces numbers that look like this for example: 2314.89 or -457.95 I need to get them into this format: 0000231489_ (where the _ represents a "blank") and 0000045795- So this field has to be 11 characters long and zero filled at the beginning. The kicker is that if it is a positive number, I need the 11th (far right) column to be blank. If it is a negative number, I need a trailing negative sign in that far right column -- Thanks from a frustrated accountant |
#3
|
|||
|
|||
Thanks Ofer it works great!!
-- Thanks from a frustrated accountant "Ofer" wrote: Mybe you can get a better answer, but you can try this IIF(MyNum 0, Format(MyNum * -100, "0000000000") & "-" , format(MyNum * 100, "0000000000") & " ") "AccessNewbie" wrote: First I just want to think all you smart people that help out on this board. You've saved my life! Now, here's my problem. The output in my query produces numbers that look like this for example: 2314.89 or -457.95 I need to get them into this format: 0000231489_ (where the _ represents a "blank") and 0000045795- So this field has to be 11 characters long and zero filled at the beginning. The kicker is that if it is a positive number, I need the 11th (far right) column to be blank. If it is a negative number, I need a trailing negative sign in that far right column -- Thanks from a frustrated accountant |
#4
|
|||
|
|||
Any time :-)
"AccessNewbie" wrote: Thanks Ofer it works great!! -- Thanks from a frustrated accountant "Ofer" wrote: Mybe you can get a better answer, but you can try this IIF(MyNum 0, Format(MyNum * -100, "0000000000") & "-" , format(MyNum * 100, "0000000000") & " ") "AccessNewbie" wrote: First I just want to think all you smart people that help out on this board. You've saved my life! Now, here's my problem. The output in my query produces numbers that look like this for example: 2314.89 or -457.95 I need to get them into this format: 0000231489_ (where the _ represents a "blank") and 0000045795- So this field has to be 11 characters long and zero filled at the beginning. The kicker is that if it is a positive number, I need the 11th (far right) column to be blank. If it is a negative number, I need a trailing negative sign in that far right column -- Thanks from a frustrated accountant |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
thank you Access newsgroup posters | Dan | General Discussion | 3 | April 18th, 2005 04:11 PM |
Number of objects | thomak | General Discussion | 3 | February 17th, 2005 11:58 AM |
How do I maintain number formatting in a mail merge? | Skittles | Mailmerge | 1 | January 28th, 2005 03:22 AM |
Conditional Number Formatting & Selective Summing | donkirk | General Discussion | 0 | June 23rd, 2004 06:02 PM |
Turning off Auto Number Formatting | Lorraine | Worksheet Functions | 1 | February 9th, 2004 10:30 PM |