Results 1 to 2 of 2

Thread: filter by formated date

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    u.s.a
    Posts
    127

    Post

    I am using the follo0ing code:
    date_text = DateValue(print_plot_patient.txdate.Text)
    sqldate = Month(date_text) & "-" & Day(date_text) & "-" & Year(date_text) ' = strmonth & "/" & strday & "/" & stryear
    Set all_cephs = dig2.OpenRecordset("select * from [all ceph query] where [operator name]='" & print_plot_patient.cboperator.Text & "'", dbOpenDynaset)

    all_cephs.Filter = "[date of analysis] =" & "#" & sqldate & "#"
    Set rs_cephs_today = all_cephs.OpenRecordset(dbOpenDynaset)
    ____________________________________
    the problem is I need the dates of my filter to match those of the database and the ones in the data base include time .
    Is there a way to compaire only the date part of a field in a table that contains date and time to a date I have in my program?
    I thaught of somthing like:

    all_cephs.Filter = format("[date of analysis],"m,d,y") =" & "#" & sqldate & "#"
    but it didn't take.
    Is there somthing similar??

    Danny Abraham.


  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Compare your dates after you convert them to longs. Internally a date field is a float with the integer portion representing date and the decimal portion representing time.



    [This message has been edited by JHausmann (edited 10-07-1999).]

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