Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Today in another forum, Anders Altberg posted a good answer to the very same question:
>>
This can easily be done in reports. There's a report field property setting for not displaying repeated values.
In a grid you can get this effect when you show two cursors with a relation set between them in one grid. If you use code like this:
USE Mytable AGAIN ALIAS xx IN 0 Order xx
SET RELATION TO dtoc(date,1) + alltrim(type)+str(voucher,4) INTO xx IN table
SET SKIP TO xx IN Mytable
SELECT mytable
Then set up a grid with the expression dtoc(Mytable.date,1) + alltrim(mytable.type)+str(mytable.voucher,4) in one column and the other columns from xx
You could of course also have a grid of mytable with all the fields except date,type, voucher.
Show these fields in three textboxes over the grid. Refresh them in the grid's AfterRowColChange. That's probabvly what I would do as first choice if I was designing a form, not a report.
>>
-Stefan
>Dear Experts
>
>Table1 has following indexing
>index on dtoc(date,1) + alltrim(type)+str(voucher,4) to abc
>
>Data in Table1 is as
>
>date---Voucher-type-amount
>9/6/2008---1---SR---500
>9/6/2008---1---SR---600
>9/6/2008---2---SR---200
>9/6/2008---2---SR---300
>10/6/2008--1---SR---400
>10/6/2008--1---SR---700
>10/6/2008--1---SC---350
>10/6/2008--1---SC---200
>
>I want to display empty DATE, VOUCHER and TYPE fields where date+type+voucher is same
>
>Following data view is required
>
> date---Voucher-type-amount
> 9/6/2008---1---SR---500
> --------------------------600
> 9/6/2008---2---SR---200
> --------------------------300
> 10/6/2008--1---SC---350
> --------------------------200
> 10/6/2008--1---SR---400
> --------------------------700
>
> Please help
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement