Results 1 to 3 of 3

Thread: [RESOLVED] VB6 & Access 2000 Date compared to date issue

  1. #1
    Hyperactive Member
    Join Date
    Jun 03
    Posts
    259

    Resolved [RESOLVED] VB6 & Access 2000 Date compared to date issue

    i cant get this simple query to work

    Code:
    rs.Open "Select * From BoardSlides WHERE SlideDisplayOnlyDate = '" & Format(Date, "mm/dd/yyyy") & "' ORDER By SlideName", connLoadLabel, adOpenForwardOnly, adLockReadOnly



    SlideDisplayOnlyDate field is a datetime field, but i get a data type mismatch in criteria expression error. SlideDisplayOnlyDate holds a date and when the app is ran and that date happens to be todays date then i want to return those records. what am i doing wrong? thanks in advance

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 02
    Location
    Bristol, UK
    Posts
    35,625

    Re: VB6 & Access 2000 Date compared to date issue

    With "Access" databases the ' delimiter is only for text values, use # for date values.

  3. #3
    Hyperactive Member
    Join Date
    Jun 03
    Posts
    259

    Re: VB6 & Access 2000 Date compared to date issue

    thanks again SI. that did it.

Posting Permissions

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