Results 1 to 2 of 2

Thread: Database scan

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    18

    Question

    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

  2. #2
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width