FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Seek or scope for not empty dates
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Seek or scope for not empty dates
Posted: 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

Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Seek or scope for not empty dates
Posted: 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Seek or scope for not empty dates
Posted: Sun Sep 15, 2013 03:09 PM

Can you give us some examples where it is a problem?

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Seek or scope for not empty dates
Posted: Sun Sep 15, 2013 05:07 PM

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Seek or scope for not empty dates
Posted: Sun Sep 15, 2013 05:45 PM

Thank you, my friends. :-)

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Seek or scope for not empty dates
Posted: Sun Sep 15, 2013 08:26 PM

Nages,

Sharp thinking! I like it.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Seek or scope for not empty dates
Posted: Tue Sep 17, 2013 07: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 (fw): Select all Collapse
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
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Seek or scope for not empty dates
Posted: Wed Sep 18, 2013 02: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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Seek or scope for not empty dates
Posted: Wed Sep 18, 2013 07: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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Seek or scope for not empty dates
Posted: Wed Sep 18, 2013 08: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

Continue the discussion