Hi Alex,

Thanks very much for helping.

So far I've done the mods to the database rel you suggested and I have this 
query:
(? (select (@A) ((year +Agenda 2019) (week +Agenda 32) (same 2019 @A year) 
(same 32 @A week)) )
which works and gives me results like these:
@A = {1643}
...
@A = {1731}

Now, is there any way to get all those results in a list like this:
( {1643} ... {1731})

in order to print them in a table with the "tab" function like:
...(with This (tab Fmt (: year) (: week) (: status))).... 

Regards,

Eric


Envoyé de mon BlackBerry - l'appareil mobile le plus sécurisé - via le réseau 
Orange


          Message original  



De: a...@software-lab.de
Envoyé: 1 octobre 2019 09:36
À: picolisp@software-lab.de
Répondre à: picolisp@software-lab.de
Objet: Re: How to query the database?


Hi Eric,

> (class +Agenda +Entity)
> (rel id (+Key +Number))
> (rel date (+date))
> (rel year (+Idx +Number))
> (rel monthnum (+Idx +Number))
> (rel monthtxt (+Idx +String))
> (rel week (+Idx +Number))
> (rel status (+Idx +String))

'+Idx' is not suitable for numbers, as it builds an index of substrings, not of
the numerical values. '+Ref' would be the best here.

Also, (+date) must be (+Date) (or better (+Ref +Date)).

> Now I want to get all the days for the whole week 32 of the year 2019. My frst
> attempt was to do something like this:
>
> (? (select (@A) ((year +Agenda 2019) (week +Agenda 32))) (show @A))

This is fine (if the indexes are fixed as above). In addition you need also
filter clauses (before the 'show'):

   (same 2019 @A year)
   (same 32 @A week)

☺/ A!ex

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to