Multi Component Key with Dates don't always work as easy as 1,2,3 
Author Message
 Multi Component Key with Dates don't always work as easy as 1,2,3

I'm hopefully looking for some clarification on this... as this is the
second time I have encountered this and I do not know why.
I have the workaround... but it makes no sense.  Breaks all common
understanding of how keys are sorted.

I have A multi-component key that consists of  a CSTRING and DATE Field.
FILE:PhonePoolKey contains FILE:PhonePool (CSTRING of 5) and
FILE:AvailableDate ( DATE type).

I always prime records with some value for FILE:PhonePool Field (e.g. '123')
The FILE:AvailableDate field will either contain 0 (for not available) or a
Date value of Today().

If I wanted to get the first record that has a phonepool of 123 with any
valid Date except 0, you would think this code below would work.

FILE:PhonePool='123'
FILE:AvailableDate=1                !Should represent the first oldest date
that CW starts with.
Set(FILE:PhonePoolKey,FILE:PhonePoolKey)
Next(PhoneFile)

Unfortunately, it returns the first record at the top of the key containing
a 0.

Workaround code:
FILE:PhonePool='123'
FILE:AvailableDate=4                !This is the only line different from
above
Set(FILE:PhonePoolKey,FILE:PhonePoolKey)
Next(PhoneFile)

Simply priming the AvailableDate with a slightly large Date value (must be 4
or greater. wierd?!?) will make the code work and retrieve the appropriate
record.
What is it with 1,2,3 as values for Date field that makes CW not properly
find the record in the key?
This key logic has worked for me in the past... the only difference was that
I used a Long instead of Date Data Type (I know, supposed to be the same
thing) and that I had "exclude null keys" on, which also should not make a
difference if the first component has a value in it always.

BTW, this is C5b... have not test under C55.

Any ideas?
Doug



Tue, 05 Aug 2003 16:38:03 GMT  
 Multi Component Key with Dates don't always work as easy as 1,2,3
Quote:

> What is it with 1,2,3 as values for Date field that makes CW not properly
> find the record in the key?

From the help file, under Standard Date:

A Clarion standard date is the number of days that have elapsed since
December 28, 1800. The range of accessible dates is from January 1, 1801
(standard date 4) to December 31, 9999 (standard date 2,994,626). Date
procedures will not return correct values outside the limits of this range.

Sent using Virtual Access 5.50 - download your freeware copy now
http://www.atlantic-coast.com/downloads/vasetup.exe



Tue, 05 Aug 2003 17:44:20 GMT  
 Multi Component Key with Dates don't always work as easy as 1,2,3
Thanks Don.

Doug


Quote:

> > What is it with 1,2,3 as values for Date field that makes CW not
properly
> > find the record in the key?

> From the help file, under Standard Date:

> A Clarion standard date is the number of days that have elapsed since
> December 28, 1800. The range of accessible dates is from January 1, 1801
> (standard date 4) to December 31, 9999 (standard date 2,994,626). Date
> procedures will not return correct values outside the limits of this
range.

> Sent using Virtual Access 5.50 - download your freeware copy now
> http://www.atlantic-coast.com/downloads/vasetup.exe



Wed, 06 Aug 2003 02:04:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help: File drops in Finder don't always work

2. Stored procedures with date parameters don't work

3. CW2003 AlertKey keys don't work

4. Function Keys Don't Work

5. Key up ,down ... sometimes don't work

6. Looking for D-EightySix (Num keys don't work in E-mail subject lines)

7. Help - cursor keys don't work in widgets-Solaris 3.3

8. Tcl Date Routines don't handle ISO date formats

9. multi component key locator help

10. ABC - Prime Record in multi component key ( C5002 )

11. Filtering multi component key

12. Multi-component Key Locator Help

 

 
Powered by phpBB® Forum Software