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?
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?