Page 1 of 1

How to specify time (and date) in UniQuery filter

Posted: Fri 08 Jan 2010 04:47
by hughespa
Hi,

I'm having trouble specifying a time in a filter correctly.

e.g. UniQuery1.Filter := 'STARTTIME = ''06.45.00''';

returns no records although there are some which start at that time and will appear if you clear the filter.

What is the correct syntax for times and what operators can I use with times in filters please?

Regards, Paul.

Posted: Fri 08 Jan 2010 23:12
by joepasquariello
paul,

if STARTTIME is of type TIME, then I think you should be using ":" separator between hours, minutes, and seconds, e.g. STARTTIME = "06:45:00"

joe

Posted: Sat 09 Jan 2010 03:02
by hughespa
Hi,

The fields are declared as type time(7) on the server and the delphi persistent fields are TTimeFields.

I had used ":" previously and just tried the "." to see if it would happen to work. I hadn't noticed that I had posted the later code containing the "."

Neither syntax seems to work anyway but thanks for your suggestion.

Regards, Paul.

Posted: Thu 14 Jan 2010 09:10
by Plash
You should use the same format as the TimeToStr function returns:

'6:45:00'

Posted: Thu 14 Jan 2010 09:27
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

Posted: Thu 14 Jan 2010 09:28
by hughespa
Hi Plash,

Thanks but I tried that first. I've also tried dropping the leading zero but it still shows no records.

I'm sure there is a problem somewhere.

All other types of fields work for filtering, it's just times that are not working.

Any other suggestions please?

Regards, Paul.