>Assume you have DIM'd the Total_Investment_unit
==> Initially did not Dim my variables, but after doing so still the same
>Assume you have confirmed that there are actual values in the DB your sourcing from and how they are actually stored.
==> Yes
> Assume that you have tried pop'ing a msgbox right after your Total_Investment_unit = rs("POS_T_INVEST_UNIT"

statement to see that at that point it is a "0".
==> Yes, the value pop up and written to log is "0"
> Assume, since your snippet is not showing it, that you are doing a Csng, Cdbl, CInt, or CLng to convert it from a variant before using it.
==> Yes, I did tried to used Cdbl but no diff
Assume that you have successfully dropped this script into an ASP page and confirmed that it is working as expected there. If so, then the same code should run without a problem (sans the <% %> ref's and etc.
==> I do not have ASP pages here, so I can't try this out
Anyway, here's my complete scripting and hope you can help me find the "bug"... thanks!
'***********************************************************
'Filename : post_conv_holding_rep.vbs
'Description : Reading data from database table and write to Excel file
'Last Updated 10/04/2003 Author -- kclow
'***********************************************************
OPTION EXPLICIT
Dim OutFileObject
Dim TheNewFolder
Dim Getlogfile
Dim ConstDataSource
Dim userid
Dim password
Dim connString
Dim conn
Dim objXLA
Dim objXLB
Dim objXL
Dim Rcount
Dim Gcost_avg
Dim Ghash_total
Dim Grecords
Dim sql_str
Dim rs
Dim Fund_Code
Dim UT_Account
Dim Settlement_Group
Dim Total_Investment_unit
Dim Total_Investment_amt
Dim Fund_Currency
Dim Average_unit_cost
Set OutFileObject = WSCRIPT.CreateObject("Scripting.FileSystemObject"
If OutFileObject.FolderExists(".\logfiles"

= False Then
Set TheNewFolder = OutFileObject.CreateFolder(".\logfiles"

End If
If OutFileObject.FileExists(".\logfiles\post_conv_holding_rep1.log"

= True Then
OutFileObject.DeleteFile ".\logfiles\post_conv_holding_rep1.log"
End If
Set Getlogfile = OutFileObject.CreateTextFile(".\logfiles\post_conv_holding_rep1.log", True)
connString = "DRIVER={Oracle ODBC Driver};DBQ=XXX;UID=xxx;PWD=xxx"
Set conn=WSCRIPT.CreateObject ("Adodb.connection"

conn.ConnectionTimeout = 180
conn.CommandTimeout = 180
conn.Open connString
Getlogfile.WriteLine("Connection to Datasource establish... " & Date() & " " & Time())
Set objXLA = WScript.CreateObject("Excel.Application"
Set objXLB = objXLA.WorkBooks.Add
Set objXL = objXLB.Worksheets("Sheet1"
Getlogfile.WriteLine("Start creating workbook..."
objXL.Cells(1, 1).Value = "Fund_code"
objXL.Cells(1, 2).Value = "Sett_mthd"
objXL.Cells(1, 3).Value = "Acct_No"
objXL.Cells(1, 4).Value = "Unit_Held"
objXL.Cells(1, 5).Value = "Purchase_Cost"
objXL.Cells(1, 6).Value = "Curr"
objXL.Cells(1, 7).Value = "Avg_Cost"
Rcount = 2
Gcost_avg = 0
Ghash_total = 0
Grecords = 0
sql_str = "select * from POSITION_HOLD where gen_insttu_code = 'OCBC' order by FUND_CODE, ACA_AC_NO"
Set rs = WScript.CreateObject("ADODB.Recordset"

rs.Open sql_str, conn, 3, 3
Getlogfile.WriteLine("Start data extraction..."
Do While Not rs.Eof
Fund_Code = rs("FUND_CODE"

UT_Account = rs("ACA_AC_NO"

Settlement_Group = rs("POS_SETT_GROUP_CODE"

Total_Investment_unit = rs("POS_T_INVEST_UNIT"

Total_Investment_amt = rs("POS_T_INVEST_IN_FUND_CCY_AMT"
Fund_Currency = rs("POS_FUND_CCY_CODE"

Average_unit_cost = rs("POS_AVG_IN_FUND_CCY_PRICE"
objXL.Cells(Rcount, 1).Value = Fund_Code
objXL.Cells(Rcount, 2).Value = Settlement_Group
objXL.Cells(Rcount, 3).Value = UT_Account
objXL.Cells(Rcount, 4).Value = CStr(Total_Investment_unit)
objXL.Cells(Rcount, 5).Value = CStr(Total_Investment_amt)
objXL.Cells(Rcount, 6).Value = Fund_Currency
objXL.Cells(Rcount, 7).Value = CStr(Average_unit_cost)
Gcost_avg = CDbl(Average_unit_cost) * 1.28
Ghash_total = Ghash_total + Gcost_avg
Rcount = Rcount + 1
Grecords = Grecords + 1
Getlogfile.WriteLine("Recordcount:" & Grecords)
If Grecords >= 10 Then
Exit Do
End If
rs.movenext
Loop
objXL.Cells(Rcount, 1).Value = "** "
objXL.Cells(Rcount+1, 1).Value = "Records count: " & Grecords
objXL.Cells(Rcount+2, 1).Value = "Hash total: " & Ghash_total
objXL.Cells.CurrentRegion.select
objXLA.Selection.Font.Bold = True
objXLA.Selection.Font.Size = 6
objXLA.Range("A1:G1"

.Select
objXLA.Selection.Font.Size = 6
objXLA.Range("A1:G1"

.Select
objXLA.Selection.Font.Bold = True
objXLA.Selection.Interior.ColorIndex = 5
objXLA.Selection.Interior.Pattern = 1
objXLA.Selection.Font.ColorIndex = 2
Getlogfile.WriteLine("End creating workbook..."
objXLB.SaveAs "D:\TEMP\post_conv_holding_rep1.xls"
objXLB.Close
objXLA.Application.Quit
Set objXL = Nothing
Set objXLB = Nothing
Set objXLA = Nothing
Getlogfile.WriteLine("Complete..." & Date() & " " & Time())
Getlogfile.Close
conn.Close
Set conn = Nothing
Msgbox "Report generated!"
WScript.quit