How to specify time (and date) in UniQuery filter

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
hughespa
Posts: 81
Joined: Sat 23 Aug 2008 08:36
Location: W. Australia

How to specify time (and date) in UniQuery filter

Post by hughespa » Fri 08 Jan 2010 04:47

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.

joepasquariello
Posts: 38
Joined: Wed 16 May 2007 01:12

Post by joepasquariello » Fri 08 Jan 2010 23:12

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

hughespa
Posts: 81
Joined: Sat 23 Aug 2008 08:36
Location: W. Australia

Post by hughespa » Sat 09 Jan 2010 03:02

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 14 Jan 2010 09:10

You should use the same format as the TimeToStr function returns:

'6:45:00'

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 14 Jan 2010 09:27

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

hughespa
Posts: 81
Joined: Sat 23 Aug 2008 08:36
Location: W. Australia

Post by hughespa » Thu 14 Jan 2010 09:28

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.

Post Reply