I added the "#" but still doesn't work
when i run the program, an error occurr :
run-time Error "3077"
wrong date syntax (something like that)

i only store a time value in the database(eg. 12:30) and I
created the database in Access97.
Help me pls, thnaks very much

"Ted" <tmcneal@mhsinc.org> wrote:
>First, it is important to know what database engine or server you are using.
> JET uses # to delimit date/time fields and SQL Server uses ' as a delimiter.
> Hence, if you want search for 12 noon the use Recordset.FindFirst "StartTime
>= #" & dteTimeValue & "#" in JET.
>Next, time values are a component of a date value. For example, if you

>0.5 to a date value it will add 12 hours. If you are only storing a time
>value in the field then this is easy. Otherwise, you will need to parse
>any whole number from the date value before you can look for a time value
>across multiple dates. To show this, go to the immediate window and type
>This will return a double value that is the actual value for the date/time.
> The whole number is the date and the decimal value is the time within the
>Ted McNeal
>"Kammy" <kammychoi@sinaman.com.hk> wrote:
>>I want to search the database for a time.
>>can anyone tell me why the following doesn't work??
>>datReserva.Recordset.FindFirst "StartTime=" & _
>>TimeSerial(Val(txtSTimeH.Text), Val(txtSTimeM.Text), 0)
>>how can i fix this??