need to count number of sale base on a date the user inputs
Private Sub datesrch()
Dim searchfor As String
Dim db As Database
Dim rs As Recordset
Dim sqlstring As String
Set db = OpenDatabase("c:\data\op\pos405\contact2\contactmanager.mdb"
searchfor = InputBox("enter new sales date"
Id is a field, salesdate is another field and contactmanager is the table name
sqlstring = "Select id, and count(contactmanager.Id) AS Noofsales FROM ContactManager and GROUP by contactmanager.Id having (((contactmanager.salesdate) = #" & searchfor & "#"
Set rs = db.OpenRecordset(sqlstring)
picResults.Print rs.Fields(" noOfsales "
End Sub
Private Sub datesrch()
Dim searchfor As String
Dim db As Database
Dim rs As Recordset
Dim sqlstring As String
Set db = OpenDatabase("c:\data\op\pos405\contact2\contactmanager.mdb"
searchfor = InputBox("enter new sales date"
Id is a field, salesdate is another field and contactmanager is the table name
sqlstring = "Select id, and count(contactmanager.Id) AS Noofsales FROM ContactManager and GROUP by contactmanager.Id having (((contactmanager.salesdate) = #" & searchfor & "#"
Set rs = db.OpenRecordset(sqlstring)
picResults.Print rs.Fields(" noOfsales "
End Sub