Range(Cell).Value = StoreSalesSF(BegDate, EndDate)
Function StoreSalesSF(BegDate1, EndDate1) As Variant
Dim conSQL As ADODB.Connection
Dim strSQL As String
Dim i As Integer
Dim Total As Variant
Dim rs As ADODB.Recordset
Total = 0
i = 0
Set conSQL = New ADODB.Connection
conSQL.Open "DSN=CDHO;Driver={Firebird/InterBase(r) driver};Dbname=192.168.0.205:d:\zzz\gdbcreation\sv1020_012HO.gbb;CHARSET=NONE;UID=BETAVIEW;Client=C:\Windows\SysWOW64\gds32.dll"
strSQL = SQLStoreSalesSF(BegDate1, EndDate1)
Set rs = New ADODB.Recordset
rs.Open strSQL, conSQL, adOpenStatic, adLockOptimistic
If Not rs.EOF Then
StoreSalesSF = rs.GetRows(-1, 1, "sum_sales")(0, 0)
If IsNull(StoreSalesSF) Then
StoreSalesSF = 0
End If
Else
StoreSalesSF = 0
End If
conSQL.Close
End Function
Range(Cell).Value = SumFunctionSF(BegDate, EndDate, "StoreSalesSF")
Function SumFunctionSF(BegDate1 As Variant, EndDate1 As Variant, Title1 As String)
Dim conSQL As ADODB.Connection
Dim strSQL, SQLName As String
Dim i As Integer
Dim Total As Variant
Dim rs As ADODB.Recordset
Total = 0
i = 0
Set conSQL = New ADODB.Connection
conSQL.Open "DSN=CDHO;Driver={Firebird/InterBase(r) driver};Dbname=192.168.0.205:d:\zzz\gdbcreation\sv1020_012HO.gbb;CHARSET=NONE;UID=BETAVIEW;Client=C:\Windows\SysWOW64\gds32.dll"
SQLCall = "SQL" & Title1
strSQL = SQLName(BegDate1, EndDate1)
Set rs = New ADODB.Recordset
rs.Open strSQL, conSQL, adOpenStatic, adLockOptimistic
If Not rs.EOF Then
SumFunctionSF = rs.GetRows(-1, 1, "sum_sales")(0, 0)
If IsNull(SumFunctionSF) Then
SumFunctionSF = 0
End If
Else
SumFunctionSF = 0
End If
conSQL.Close
End Function
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE