|
本帖最后由 netguestcn 于 2013-10-11 18:33 编辑
Public Function getRate(ByVal myDate As Date) As Double
Dim Conn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strSQL As String
Dim i As Integer
Set Conn = CurrentProject.Connection
strSQL = "Select * FROM 汇率表 ORDER BY 日期 DESC"
rst.Open strSQL, Conn, adOpenKeyset, adLockOptimistic
rst.MoveFirst
For i = 1 To rst.RecordCount
If rst("日期") <= myDate Then
getRate = rst("汇率")
Exit For
Else
rst.MoveNext
End If
Next i
rst.Close
Set rst = Nothing
Set Conn = Nothing
End Function
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|