Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TFDQuery.Filter between date variables


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jul 23, 2017 6:15 PM Last Post By: Diego Rodrigues...
Jim Sawyer

Posts: 214
Registered: 1/3/10
TFDQuery.Filter between date variables  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2017 12:53 PM
I want to use the TFDQuery.Filter property to specify that the field "Date" is
between the variables dStart and dEnd, how do I write it?

Thanks,
Jim Sawyer
Diego Rodrigues...

Posts: 11
Registered: 8/19/17
Re: TFDQuery.Filter between date variables  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2017 5:48 PM   in response to: Jim Sawyer in response to: Jim Sawyer
Jim Sawyer wrote:
I want to use the TFDQuery.Filter property to specify that the field "Date" is
between the variables dStart and dEnd, how do I write it?

Thanks,
Jim Sawyer
FDQuery.Filter := 'Date BETWEEN {d ' + FormatDateTime('yyyy-mm-dd', dStart) + '} AND {d ' + FormatDateTime('yyyy-mm-dd', dEnd) + '}';


might work. But it's difficult to read. I would consider different way.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02