Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TQuery: How to filter this?

Status
Not open for further replies.

skss

Programmer
Oct 7, 2003
22
0
0
HK
Normally, if I want to filter according to a range, for example according to a range of dates, I would write the code like the following:

rpt1.Report1.sql.Filter := ('[date]>=' + QuotedStr(Edit1.Text) + 'and [date]<=' + QuotedStr(Edit2.Text));

Now, what if I want to filter, for example, all the customers from the region of Asia to Europe only? The user will key in the start and end region but the filtering doesnt work like it did for the dates.

This doesnt work:
rpt1.Report1.sql.Filter := ('[region_desc]>=' + QuotedStr(Edit1.Text) + 'and [region_desc]<=' + QuotedStr(Edit2.Text));

Why is that so? Can someone shed a light on this and what I have to do to be able to filter according to the user input?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top