1. Che
Senior Member
Join Date
Dec 1969
Posts
303

I need to read the values from my Access DB and see whether each field (CODE) is having 7 Digits(including Decimal) like "4" Digits after the Decimal Point. If any row doesn&#039;t have "4" digits after the "Decimal" point i need to add "0" at the end to make total "4 Digits"... <BR>-----------------------------------------<BR>Here is the Data from my Access Table:<BR>-----------------------------------------<BR>04.<BR>03.10<BR>03.0190<BR>02.0<BR>02.122<BR>0 5.30<BR>****************************************** <BR><BR>Set cnnExcel = Server.CreateObject("ADODB.Connection")<BR> cnnExcel.Open ("DSN=Emp")<BR>Set rstExcel = Server.CreateObject("ADODB.Recordset")<BR><BR>MySq l = "SELECT CIPCODE FROM tblcipp" <BR><BR>rstExcel.Open MySql, cnnExcel<BR><BR>Val = rstExcel.Fields("CIPCODE")<BR><BR>"I think i need to Use Split here and then read the value then add the Zeros at the end if its not equal to 4 Digits" but i am not sure, help me<BR>

2. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

something like this<BR><BR>a = Split(YourValue , ".")<BR>a(1) = Left(a(1) & "0000", 4)<BR>YourValue = Join(a, ".")<BR><BR>

3. Che
Senior Member
Join Date
Dec 1969
Posts
303

I did not give you the enough information about what i am lookinf for... sorry for that....<BR><BR>First i need to know the number of Digits after the Decimal Point like if i have 2 digits after the Decimal Point i need to add 2 more Zeros at the end and if i have 1 digit after the Decimal point i need to add 3 more Zeros at the end...

4. Senior Member
Join Date
Dec 1969
Posts
11,247

## I gotta smile

AK gave you the code which will work

5. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## What about FormatNumber() ? (eop)

.

6. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## that too i guess

it all depends<BR><BR><BR>23. is not really what i would expect is saved in the db....but yeah i guess that should work great too<BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•