Seek or scope for not empty dates

Seek or scope for not empty dates

Postby Enrico Maria Giordano » Sun Sep 15, 2013 11:59 am

Dear friends, how can I seek or scope for not empty dates other than using an index with for clause !Empty( FIELD -> date )?

Thank you in advance for any ideas.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Seek or scope for not empty dates

Postby ADutheil » Sun Sep 15, 2013 12:54 pm

If you have an index based on filed->DATE you might soft seek ou bottom scope to the first day of the epoch your are set.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Seek or scope for not empty dates

Postby James Bott » Sun Sep 15, 2013 3:09 pm

Can you give us some examples where it is a problem?
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Seek or scope for not empty dates

Postby nageswaragunupudi » Sun Sep 15, 2013 5:07 pm

ORDSCOPE( 0, CTOD( "" ) + 1 )
DBSEEK( CTOD("") + 1, .T. ) // softseek
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Re: Seek or scope for not empty dates

Postby James Bott » Sun Sep 15, 2013 8:26 pm

Nages,

Sharp thinking! I like it.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Seek or scope for not empty dates

Postby Enrico Maria Giordano » Tue Sep 17, 2013 7:59 pm

One more puzzle. :-)

What about to seek or to scope for a logical value + a string? Currently I'm using this index key:

Code: Select all  Expand view
INDEX ON IF( FIELD -> priorita, " ", "*" ) + UPPER( FIELD -> societa ) TO SOCIETA2

SEEK " "
SEEK "*"

SET SCOPE TO " "
SET SCOPE TO "*"


But I'd like to use a simpler key, removing IF() if possible. Any ideas?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Seek or scope for not empty dates

Postby ADutheil » Wed Sep 18, 2013 2:35 am

You could create 2 distincs tags with FOR clause, one FOR priorita and the other FOR !priorita. Otherwise I can´t see how to get rid of the IF.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Seek or scope for not empty dates

Postby Enrico Maria Giordano » Wed Sep 18, 2013 7:53 am

ADutheil wrote:You could create 2 distincs tags with FOR clause, one FOR priorita and the other FOR !priorita. Otherwise I can´t see how to get rid of the IF.


Thank you.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Seek or scope for not empty dates

Postby Enrico Maria Giordano » Wed Sep 18, 2013 8:12 am

ADutheil wrote:You could create 2 distincs tags with FOR clause, one FOR priorita and the other FOR !priorita. Otherwise I can´t see how to get rid of the IF.


I just realized that I need that index for records sort, not for seek or scope. So your idea doesn't solve my problem, sorry. :-(

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests