 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Franco Jommi Guest
|
Posted: Sat Feb 28, 2004 10:54 am Post subject: Sorry I ask this question |
|
|
It's incredible, but I can't figure out how to set a stuoìpid filter on a
date, and I have to ask somebody! I need, first to filter out all of the
records with a null expiry date, and then those with an expiry date less
then the current date.
I just need to set the Filter property of my TTable, and I didn't find the
correct way, since in the filter it looks I can't use expressions.
Can you help ? I am stuck!
|
|
| Back to top |
|
 |
Franco Jommi Guest
|
Posted: Sun Feb 29, 2004 10:56 am Post subject: Re: Sorry I ask this question |
|
|
Noone answered ! No ideas ?
"Franco Jommi" <franco.jommmi (AT) tin (DOT) it> ha scritto nel messaggio
news:Ar_%b.33686$gk.1401734 (AT) news3 (DOT) tin.it...
| Quote: | It's incredible, but I can't figure out how to set a stuoìpid filter on a
date, and I have to ask somebody! I need, first to filter out all of the
records with a null expiry date, and then those with an expiry date less
then the current date.
I just need to set the Filter property of my TTable, and I didn't find the
correct way, since in the filter it looks I can't use expressions.
Can you help ? I am stuck!
|
|
|
| Back to top |
|
 |
David Reeve Guest
|
Posted: Sun Feb 29, 2004 12:09 pm Post subject: Re: Sorry I ask this question |
|
|
"Franco Jommi" <franco.jommmi (AT) tin (DOT) it> wrote
| Quote: | Noone answered ! No ideas ?
"Franco Jommi" <franco.jommmi (AT) tin (DOT) it> ha scritto nel messaggio
news:Ar_%b.33686$gk.1401734 (AT) news3 (DOT) tin.it...
It's incredible, but I can't figure out how to set a stuoìpid filter on
a
date, and I have to ask somebody! I need, first to filter out all of
the
records with a null expiry date, and then those with an expiry date
less
then the current date.
I just need to set the Filter property of my TTable, and I didn't find
the
correct way, since in the filter it looks I can't use expressions.
Can you help ? I am stuck!
|
It's not something I do a lot of, but I seem to remember that the
TDataSet.OnFilterRecord event is the way to have flexibility when filtering.
Check the help on this event. There is an example of filtering on a date
field.
Dave
|
|
| Back to top |
|
 |
pr Guest
|
Posted: Sun Feb 29, 2004 3:57 pm Post subject: Re: Sorry I ask this question |
|
|
"Franco Jommi" <franco.jommmi (AT) tin (DOT) it> wrote
| Quote: | Noone answered ! No ideas ?
"Franco Jommi" <franco.jommmi (AT) tin (DOT) it> ha scritto nel messaggio
news:Ar_%b.33686$gk.1401734 (AT) news3 (DOT) tin.it...
It's incredible, but I can't figure out how to set a stuoìpid filter on
a
date, and I have to ask somebody! I need, first to filter out all of
the
records with a null expiry date, and then those with an expiry date
less
then the current date.
I just need to set the Filter property of my TTable, and I didn't find
the
correct way, since in the filter it looks I can't use expressions.
Can you help ? I am stuck!
|
filter := 'TheDate IS NOT NULL and TheDate<' + '''' + '01/12/2003' + '''';
You may need double quotes instead of single ones around the date,
date separators according to your windows settings and possibly
the date in US format. But do yourself a favour, use a Query for stuff
like that.
PR
|
|
| Back to top |
|
 |
Franco Jommi Guest
|
Posted: Mon Mar 01, 2004 1:23 pm Post subject: Re: Sorry I ask this question |
|
|
The problem I have with the Query is that the resulting dataset is not
easily updatable as it is a TTable, at least in my dBase environment... What
I want to achieve is to keep on my Table all of the records, including those
with an expired date, but I only want to work with the part of the Table
"not expired". Under certain circumstances, I may have to use additional
filters, but the "expiry date" filter should always work.
I don't like too much this solution, but I didn't find another one. For
instance, I didn't want to use an OnFilter event, since this may intefere
with the use of additional filters, as I said above, nor did I find a way to
pass to the OnFilter event a filter string created outside of the event
routine. But, probably I don't know enough...
"pr" <shin (AT) netactive (DOT) co.za> ha scritto nel messaggio
news:40424068.0 (AT) news1 (DOT) mweb.co.za...
| Quote: |
"Franco Jommi" <franco.jommmi (AT) tin (DOT) it> wrote in message
news:Wzj0c.38068$gk.1602912 (AT) news3 (DOT) tin.it...
Noone answered ! No ideas ?
"Franco Jommi" <franco.jommmi (AT) tin (DOT) it> ha scritto nel messaggio
news:Ar_%b.33686$gk.1401734 (AT) news3 (DOT) tin.it...
It's incredible, but I can't figure out how to set a stuoìpid filter
on
a
date, and I have to ask somebody! I need, first to filter out all of
the
records with a null expiry date, and then those with an expiry date
less
then the current date.
I just need to set the Filter property of my TTable, and I didn't find
the
correct way, since in the filter it looks I can't use expressions.
Can you help ? I am stuck!
filter := 'TheDate IS NOT NULL and TheDate<' + '''' + '01/12/2003' + '''';
You may need double quotes instead of single ones around the date,
date separators according to your windows settings and possibly
the date in US format. But do yourself a favour, use a Query for stuff
like that.
PR
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|