L
Linda
I have the following routine:
Set rstin = dbs.OpenRecordset("Select * From
detailsmobile Where CallDate Between #" & varDateBeg & "#
And #" & varDateEnd & "#")
Set rstsplit = dbs.OpenRecordset("tblTenants")
Set rstout = dbs.OpenRecordset("tblresult")
Note: vardatebeg contains the value #01/01/2004#
and vardateend contains the value #02/01/2004#
tbltenants contains the Telephonenrs and the startdates
and the enddates.
rstsplit.MoveFirst
Do Until rstsplit.EOF
If rstsplit!EndDate >= varDateBeg And rstsplit!EndDate <=
varDateEnd Then
searchnumber = rstsplit!TelephoneNumber
FindFirst "CallingNumber='" & searchnumber & "'"
If rstin.NoMatch Then
rstin.Edit
Else
rstout.AddNew
rstout!TelephoneNumber = rstin!CallingNumber
rstout!OccupantID = rstsplit!OccupantID
rstout.Update
End If
End If
rstsplit.MoveNext
Loop
what I want to do here is that when the end date from
tbltenants fall with the period of vardatebeg and
enddatebeg that the telephonennr and occupantid gets
added to the table tblresult.
In my table tbltenants I have some enddates that meet
that criteria and for some strange reason my routine does
not pick up these rows.meaning they don't get added to
the tblresult.also in the query detailsmobile for each
telephonenr and calldate there is an amount, a sum should
made of the amounts that fall within the condition:
If rstsplit!EndDate >= varDateBeg And rstsplit!EndDate <=
varDateEnd, so for example if the enddate is 01/10/2004
then a total should be made for all calls made between
01/01/2004 and 01/10/2004. Any help is most appreciated.
Set rstin = dbs.OpenRecordset("Select * From
detailsmobile Where CallDate Between #" & varDateBeg & "#
And #" & varDateEnd & "#")
Set rstsplit = dbs.OpenRecordset("tblTenants")
Set rstout = dbs.OpenRecordset("tblresult")
Note: vardatebeg contains the value #01/01/2004#
and vardateend contains the value #02/01/2004#
tbltenants contains the Telephonenrs and the startdates
and the enddates.
rstsplit.MoveFirst
Do Until rstsplit.EOF
If rstsplit!EndDate >= varDateBeg And rstsplit!EndDate <=
varDateEnd Then
searchnumber = rstsplit!TelephoneNumber
FindFirst "CallingNumber='" & searchnumber & "'"
If rstin.NoMatch Then
rstin.Edit
Else
rstout.AddNew
rstout!TelephoneNumber = rstin!CallingNumber
rstout!OccupantID = rstsplit!OccupantID
rstout.Update
End If
End If
rstsplit.MoveNext
Loop
what I want to do here is that when the end date from
tbltenants fall with the period of vardatebeg and
enddatebeg that the telephonennr and occupantid gets
added to the table tblresult.
In my table tbltenants I have some enddates that meet
that criteria and for some strange reason my routine does
not pick up these rows.meaning they don't get added to
the tblresult.also in the query detailsmobile for each
telephonenr and calldate there is an amount, a sum should
made of the amounts that fall within the condition:
If rstsplit!EndDate >= varDateBeg And rstsplit!EndDate <=
varDateEnd, so for example if the enddate is 01/10/2004
then a total should be made for all calls made between
01/01/2004 and 01/10/2004. Any help is most appreciated.