M
Monique
I have a table of orders called ‘tblDuesod’. I want to calculate the total
cost (EuroSodCost) of the orders which have a delivery date (DelivDate)
between 2 specific dates, then plug plug the result in the control of a
report. I want to do this for each half-month period thru the year.
I made individual queries but cannot figure out how to plug all the results
in a report.
I tried a single query with IIf() and got nowhere.
I turned to code. Here it is but it’s not working. It give me a '€0' in
the report control. I know the connection is working as it finds out that
the field is in euros. Can you help ?
Dim JuneOne As Currency
Dim myConnection As ADODB.Connection
Set myConnection = CurrentProject.Connection
Dim recordset2 As New ADODB.Recordset
recordset2.ActiveConnection = myConnection
recordset2.CursorType = adOpenStatic
recordset2.Open ("SELECT sum(EuroSodCost) AS [JuneOne] FROM tblDuesSod WHERE
(DelivDate) between #6/01/2008# and #6/16/2008#;")
Me![txtJune1] = JuneOne
recordset2.Close
cost (EuroSodCost) of the orders which have a delivery date (DelivDate)
between 2 specific dates, then plug plug the result in the control of a
report. I want to do this for each half-month period thru the year.
I made individual queries but cannot figure out how to plug all the results
in a report.
I tried a single query with IIf() and got nowhere.
I turned to code. Here it is but it’s not working. It give me a '€0' in
the report control. I know the connection is working as it finds out that
the field is in euros. Can you help ?
Dim JuneOne As Currency
Dim myConnection As ADODB.Connection
Set myConnection = CurrentProject.Connection
Dim recordset2 As New ADODB.Recordset
recordset2.ActiveConnection = myConnection
recordset2.CursorType = adOpenStatic
recordset2.Open ("SELECT sum(EuroSodCost) AS [JuneOne] FROM tblDuesSod WHERE
(DelivDate) between #6/01/2008# and #6/16/2008#;")
Me![txtJune1] = JuneOne
recordset2.Close