Does anybody knows how to search in a database for a field that matches with this:
Month(date) = Month(field) and Day(Date) = Day(Field)
I want the program to pick the fields that match with todays month and day values
Printable View
Does anybody knows how to search in a database for a field that matches with this:
Month(date) = Month(field) and Day(Date) = Day(Field)
I want the program to pick the fields that match with todays month and day values
Hello ALFA117,
Hopefully is this where you searching for:
Private Sub Form_Load()
Dim DB As Database
Dim RS As Recordset
Set DB = OpenDatabase("c:\q.mdb")
Set RS = DB.OpenRecordset("select * from DateTable")
RS.MoveFirst
While Not RS.EOF
If Month(Date) = Month(RS!DateField) And Day(Date) = Day(RS!DateField) Then DoSomeThing
RS.MoveNext
Wend
End Sub
Nice regards,
Michelle.