CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: rs.filter

  1. #1
    Join Date
    Aug 2000
    Posts
    242

    rs.filter

    Hello

    I am using the recordset filter

    dim buildFilter as string
    buildFilter filterLine = "RECORD_KEY LIKE ' " & txt1.text & "*' "
    RS.Filter = buildFilter



    As long as the buildFilter is string I have no problem but if I try to use between I get error...

    I need a way to filter a text.
    my string format is "yyyy/mm/dd"
    I need that when the user enter 2003 all the records with this year will pass the filter and the others will be "removed". and so on, when the user enters 12 all the records of december of that year will be selected.

    Any ideas?

  2. #2
    Join Date
    Aug 2001
    Posts
    1,447
    if I try to use between I get error
    huh?
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  3. #3
    Join Date
    Aug 2000
    Posts
    242
    between :
    like in sql
    select date where
    date between 1/1/2003 and 31/12/2004


    but I prefer a way that the date format will be YYYY/mm/dd

    So when the user press 2 all the dates of the 2***/**/** will be selected...
    when he complete entering the year 2003 just the date of this year will appear in the rs... 2003/**/**
    and so on with the month 2003/12/** just dates in december 2003 etc.

    Since someone used the filter for a date I bet there is something like that but from some reson I can't find it.

    Thank you for telling me my question was not clear I hope that now it makes more sense

    Asaf

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

Featured