|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how:
a.) number to word b.) running balance |
|
#2
|
||||
|
||||
|
Hali,
To convert number to word (you mean text) use: Str(Number) Be more specific on both points. BRegs, TBÁrpi |
|
#3
|
|||
|
|||
|
my problem actually is about
1.) CONVERTING NUMBER TO WORDS EXAMPLE: NUMBER: 100 WORD: One Hundred 2.) RUNNING BALANCE i have this column: ecode employee payable payment balance 11044 Moe Jr. 100.00 50.00 50.00 100.00 150.00 150.00 300.00 can u help me with this |
|
#4
|
|||
|
|||
|
Here is a function that will work, I can't take credit for it becuase I found it on the internet, that converts numbers into word. I use it all the time. You will need to pass you value to it as a string. Use the Str(Number) that TBÁrpi should you to convert the interger value to a string value before passing it to the function
I need more clarification on your second question. Good Luck S- Public Function Convert_Dollar(iDollar As String) As String 'first set up two arrays to convert numbers to words Dim BigOnes(9) As String Dim SmallOnes(19) As String Dim Dollars As String Dim cents As String Dim Words As String Dim Chunk As String Dim digits As String Dim leftDigit As String Dim RightDigit As String 'and populate them BigOnes(1) = "Ten" BigOnes(2) = "Twenty" BigOnes(3) = "Thirty" BigOnes(4) = "Forty" BigOnes(5) = "Fifty" BigOnes(6) = "Sixty" BigOnes(7) = "Seventy" BigOnes(8) = "Eighty" BigOnes(9) = "Ninety" SmallOnes(1) = "One" SmallOnes(2) = "Two" SmallOnes(3) = "Three" SmallOnes(4) = "Four" SmallOnes(5) = "Five" SmallOnes(6) = "Six" SmallOnes(7) = "Seven" SmallOnes(8) = "Eight" SmallOnes(9) = "Nine" SmallOnes(10) = "Ten" SmallOnes(11) = "Eleven" SmallOnes(12) = "Twelve" SmallOnes(13) = "Thirteen" SmallOnes(14) = "Fourteen" SmallOnes(15) = "Fifteen" SmallOnes(16) = "Sixteen" SmallOnes(17) = "Seventeen" SmallOnes(18) = "Eighteen" SmallOnes(19) = "Nineteen" 'format the incoming number to guarantee six digits 'to the left of the decimal point and two to the right 'and then separate the dollars from the cents iDollar = Format(iDollar, "000000.00") Dollars = Left(iDollar, 6) cents = Right(iDollar, 2) Words = "" 'check to make sure incoming number is not too large If Dollars > 999999 Then 'Text2.Text = "Dollar amount is too large" Exit Function End If 'separate the dollars into chunks If Dollars = 0 Then Words = "Zero" Else 'first do the thousands Chunk = Left(Dollars, 3) If Chunk > 0 Then GoSub ParseChunk Words = Words & " Thousand" End If 'do the rest of the dollars Chunk = Right(Dollars, 3) If Chunk > 0 Then GoSub ParseChunk End If End If 'concatenate the cents and display If cents = 0 Then cents = "No" Words = Words & " & " & cents & "/100" 'Text2.Text = Words Convert_Dollar = Words Exit Function ParseChunk: digits = Mid(Chunk, 1, 1) If digits > 0 Then Words = Words & " " & SmallOnes(digits) & " Hundred" End If digits = Mid(Chunk, 2, 2) If digits > 19 Then leftDigit = Mid(Chunk, 2, 1) RightDigit = Mid(Chunk, 3, 1) Words = Words & " " & BigOnes(leftDigit) If RightDigit > 0 Then Words = Words & " " & SmallOnes(RightDigit) End If Else If digits > 0 Then Words = Words & " " & SmallOnes(digits) End If End If Return End Function |
|
#5
|
|||
|
|||
|
SELECT Orders.EmployeeID AS EmpAlias, Sum(Orders.Freight) AS SumOfFreight, Format(DSum("Freight","Orders","[EmployeeID]<=" & [EmpAlias] & ""),"$0,000.00") AS RunTot
FROM Orders GROUP BY Orders.EmployeeID; This will give you a running total. Play with it S- |
|
#6
|
|||
|
|||
|
Inquiry
How would i do that? I still can't get it...
Please bear with me, i'm new to access.. Thanks! |
|
#7
|
|||
|
|||
|
what can't you get
S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > formulas: convert number to words & compute for running balance |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|