Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Having Grid & View Trouble
Message
From
28/02/2000 10:27:21
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00338413
Message ID:
00338423
Views:
13
>Hi everyone,
>I am new to the VFP Environment and have been trying to convert some old DOS base apps
>over to the VPF platform. But I still have not been able to understand or get it to work properly.
>
>Let me try to explain, my tables are as follows:
>
>..........[ANITABLE]...[CUSTOMER]....[ANITBL]...[TFREETBL]...[CCT]
>Key......tktnum...............cid...............aninum......tfreenum........ccn
>FKey.....cid....................cid..................cid............cid
>FLd1....Cname..............cname...............................................chname
>
>As you can tell the [ANITBL] AND [TFREETBL] only have the phone number (aninum)
>and the tollfree number (tfreenum) respectively. That is the only data that I need from
>them. The [CCT] has another field (chname) but I do not need it in the [ANITABLE]
>form. I have tried to create 3-4 single views then create one view from the single views
>to give me the fields that I need for the grid, but it did not work. I tried to create a single view
>with those same tables and still could not get it to come up with the right data. My best effort
>was when I came up with the data but it was duped. In another words, see the following..
>
> Cust #132 has (2) phone #'s and (1) 800 and (1) calling card like this
>
>.................[aninum]........[tfreenum]....................[ccn]
>phone#: 3181231234..800#:8001231234....CC#:5570600
>..............3181231235
>
>Table View of all 3 table joined.
>CID.....ANINUM.....TFREENUM....CNN
>132...3181231234..8001231234..5570600
>132...3181231235..8001231234..5570600
>
>Now as you see there is only 1 customer but 2 cust #'s prob due to the fact that
>there are 2 different ANI #'s but see the TFREE #'s dbl as well as the CNN #'s
>Now I think that this is due to the 2 ANI's but I do not understand how to
>get just the data I need. My screen with my grid [ANITABLE] should look
>like the following:
>
>________________________________________________________________
>|.TKT#:132..................................................................DATE:02/25/2000....|
>| .............................................................................................................|
>| Michael Daniel............................Site#:1...........Monroe............................|
>|..............................................................................................................|
>|...........|ANINUMBER.......|..........Toll FREE........|.........CCN..............|.......|
>|...........|318-123-1234.......|.......800-123-1234......|......557-0600..........|.......|
>|...........|318-123-1235.......|.................................|.............................|.......|
>|...........|..........................|..................................|.............................|.......|
>|...........|_______________|___________________|_________________|.......|
>|_______________________________________________________________|
>
>Now please understand that ANINUMBER, Toll Free and CCN are the only Grid fields.
>
>If you can help me solve or understand this problem, I would sure appceiate the help.
>I love the environment and I am sure that VFP can do this but being as new to it as I am
>It seems very alien to me.
>
>Thank you for your time.
>
>Mike Daniel

One of the first things you'll learn when working with VFP views is that the designer is dysfunctional- it doesn't handle views with more than two joins. But you can still create those views in code with CREATE SQL VIEW. Better yet, you can maintain them visually outside the view designer with EView. You can get it here from the files section.

Another hint, basing a view off of a view is generally a bad idea if it can at all be avoided. Try and see if you can build your query with a single SQL statement.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform