PDA

Click to See Complete Forum and Search --> : filter by formated date


danab
Oct 6th, 1999, 09:36 AM
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.

JHausmann
Oct 6th, 1999, 11:56 AM
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).]