Re: Help on creating this report
- From: "Cindy Winegarden" <cindy_winegarden@xxxxxxx>
- Date: Sat, 18 Jun 2005 14:28:40 -0400
Hi Dorian,
The easiest way to do complicated reports is to pre-process the data exactly
the way you want it and then run the data from the temporary cursor you've
created.
To parse out the names in the Recip column I'd use the GetWordNum()
function. If you use "," for the delimiter parameter it will remove the
comma. I.e. GetWordNum(Recip, 2, ",") Then I'd use a Union query to add the
second name to the cursor of the first name.
Create Cursor Test(Document C(4), Recip C(20), Name C(10))
Insert Into Test Values ("Doc1", "Sue", "Adams")
Insert Into Test Values ("Doc1", "Sue", "Adelt")
Insert Into Test Values ("Doc1", "Sue, Nancy", "Adams")
Insert Into Test Values ("Doc1", "Sue, Nancy", "Carlton")
Insert Into Test Values ("Doc2", "Sue", "Bolts")
*--
Select ;
Document, ;
Padr(Alltrim(GetWordNum(Recip, 1, ",")), 10) As Recip, ;
Name ;
>From Test ;
Union ;
Select ;
Document, ;
Padr(Alltrim(GetWordNum(Recip, 2, ",")), 10) As Recip, ;
Name ;
>From ;
Test ;
Where ;
Not Empty(GetWordNum(Recip, 2, ",")) ;
Into Cursor ;
ReportCursor ;
Order By ;
2, 1, 3
*--
What I don't understand is the significance of the A, B, C columns for Sue
and the B, C, D columns for Nancy.
--
Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
cindy_winegarden@xxxxxxx www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden
"Dorian Chalom" <DChalom@xxxxxxxxxxx> wrote in message
news:%23ZdpVfncFHA.3060@xxxxxxxxxxxxxxxxxxxxxxx
>I have a data file of:
>
> Document Recip Name
> Doc1 Sue Adams
> Doc1 Sue Adelt
> Doc1 Sue, Nancy Brigs
> Doc1 Sue, Nancy Carlton
> Doc2 Sue Bolts
>
> and I would like to create a report like:
> Sue
> A B C
> Doc1 2 1 1
> Doc2 1
>
> Nancy
> B C D
> Doc1 1 1
>
> For reasons beyond my control the recip column has to have multiple names
> in it and I can create on record for each.
>
> TIAFYH (Thanks In Advance For Your Help)
>
>
>
.
- Follow-Ups:
- Re: Help on creating this report
- From: Dorian Chalom
- Re: Help on creating this report
- References:
- Help on creating this report
- From: Dorian Chalom
- Help on creating this report
- Prev by Date: Help on creating this report
- Next by Date: Re: Help on creating this report
- Previous by thread: Help on creating this report
- Next by thread: Re: Help on creating this report
- Index(es):
Relevant Pages
|