For Programmers: Free Programming Magazines  


Home > Archive > Clipper > June 2004 > index









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author index
hpy_awad@yahoo.com

2004-06-16, 3:55 pm

I failed to index date with numeric fields. what is the best way to
join numeric with date fields ?

select 1
use contract
index on dtos(start_date)+str(account_no) to contrac1
use contract index contrac1

I find problems with date format in get and read. please give an
working example.
Goupil

2004-06-16, 3:55 pm

Hi,
You have to give a constant lenght to your index string, which is not the
case with str("") without parameters...
Richard use str(my_numvar,n) n=max lenght of my_numvar
"hpy_awad@yahoo.com" <ehab_aziz2001@yahoo.com> a écrit dans le message de
news: 7ecaee57.0406160718.641940ff@posting.google.com...
> I failed to index date with numeric fields. what is the best way to
> join numeric with date fields ?
>
> select 1
> use contract
> index on dtos(start_date)+str(account_no) to contrac1
> use contract index contrac1
>
> I find problems with date format in get and read. please give an
> working example.



Ray Marron

2004-06-16, 8:55 pm

"Goupil" <r.flouriot@wanadoo.fr> wrote in message
news:capvrr$s63$1@news-reader2.wanadoo.fr...
> Hi,
> You have to give a constant lenght to your index string, which is
> not the case with str("") without parameters...
> Richard use str(my_numvar,n) n=max lenght of my_numvar


Not necessarily. CA-Clipper assumes the length and decimals of the field
definition when used in an index expression.

OP: Please be more specific than "failed" or "problems". Do you get an
error (error number?) or does your s fail (give sample code/data)?

--
Ray Marron


Stephen Quinn

2004-06-16, 8:55 pm

hpy

> select 1
> use contract
> index on dtos(start_date)+str(account_no) to contrac1


No need for the 2nd USE as the just created index will be the current one, if you want to leave it
in I'd suggest closing the previous instance first.
Eg
close
> use contract index contrac1


> I find problems with date format in get and read. please give an
> working example.

What problems??
Example
dDate := Date()
@ 5,5 GET dDate PICTURE 'DD/MM/YYYY'
read

Have you tried any of the following commands
- there are others that may apply (see ng)
SET CENTURY ON
SET EPOCH 1980
SET DATE TO FRENCH
SET DATE FORMAT TO MM/DD/YYYY'

--
HTH
Steve Quinn


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com