Creating a data subset in a grid

Creating a data subset in a grid

Post by Rod Smit » Tue, 05 Jan 1999 04:00:00



Can anyone help me out!  Using VFP 6.0, I have two grids on seperate
pages in a frame linked to the same table.  If  field x contains .T. I
want the data to show up in table 1, if it's false I want it in table
2.  Would I use an SQL statement in rowsource to create a filter?
 
 
 

Creating a data subset in a grid

Post by Tim Witor » Tue, 05 Jan 1999 04:00:00



> Can anyone help me out!  Using VFP 6.0, I have two grids on seperate
> pages in a frame linked to the same table.  If  field x contains .T. I
> want the data to show up in table 1, if it's false I want it in table
> 2.  Would I use an SQL statement in rowsource to create a filter?

You could base each grid on its own view.  One
would select the rows where the value is .T. and
the other where it is .F.:

CREATE SQL VIEW grid1View AS ;
  SELECT * ;
  FROM myTable ;
  WHERE myField = .T.

CREATE SQL VIEW grid2View AS ;
  SELECT * ;
  FROM myTable ;
  WHERE myField = .F.

You could also make the recordSourceType a SQL statement
and put the above select statements into the recordSource.

-- TRW

 
 
 

Creating a data subset in a grid

Post by Rod Smit » Wed, 06 Jan 1999 04:00:00


Thanks for your help Tim.  I tried your suggestion of placing the select
statement in the recordsource.  I still ended up with no data in the grid
but a browse window came up with the info in it.  Any further suggestions?



> > Can anyone help me out!  Using VFP 6.0, I have two grids on seperate
> > pages in a frame linked to the same table.  If  field x contains .T. I
> > want the data to show up in table 1, if it's false I want it in table
> > 2.  Would I use an SQL statement in rowsource to create a filter?

> You could base each grid on its own view.  One
> would select the rows where the value is .T. and
> the other where it is .F.:

> CREATE SQL VIEW grid1View AS ;
>   SELECT * ;
>   FROM myTable ;
>   WHERE myField = .T.

> CREATE SQL VIEW grid2View AS ;
>   SELECT * ;
>   FROM myTable ;
>   WHERE myField = .F.

> You could also make the recordSourceType a SQL statement
> and put the above select statements into the recordSource.

> -- TRW

--
Please remove the word BLOCK in the return address when replying.

Vintners Cellar: http://www3.ns.sympatico.ca/rdsmith

 
 
 

Creating a data subset in a grid

Post by Nik Ven » Tue, 19 Jan 1999 04:00:00


You need to re-direct output from the browse to a cursor - just add
selec .... ;
..   ;
...   ;
into cursor mygridtemp

to the SQL statement in the grid

Nik


>Thanks for your help Tim.  I tried your suggestion of placing the select
>statement in the recordsource.  I still ended up with no data in the grid
>but a browse window came up with the info in it.  Any further suggestions?



>> > Can anyone help me out!  Using VFP 6.0, I have two grids on seperate
>> > pages in a frame linked to the same table.  If  field x contains .T. I
>> > want the data to show up in table 1, if it's false I want it in table
>> > 2.  Would I use an SQL statement in rowsource to create a filter?

>> You could base each grid on its own view.  One
>> would select the rows where the value is .T. and
>> the other where it is .F.:

>> CREATE SQL VIEW grid1View AS ;
>>   SELECT * ;
>>   FROM myTable ;
>>   WHERE myField = .T.

>> CREATE SQL VIEW grid2View AS ;
>>   SELECT * ;
>>   FROM myTable ;
>>   WHERE myField = .F.

>> You could also make the recordSourceType a SQL statement
>> and put the above select statements into the recordSource.

>> -- TRW

>--
>Please remove the word BLOCK in the return address when replying.

>Vintners Cellar: http://www3.ns.sympatico.ca/rdsmith

 
 
 

1. Calculated subtotal of a subset of a subset in a file

I'm trying to get a calculated subtotal of a subset of a subset in a file to
appear in a calculated field.

Trades (file) (500 records)
    Account Number (text field) (50 records)
        Ticker (text field) (5 records)
            Net (number field) (5 records)

                looking for sum of 'Net' for those 5 records

Would like to have a calculated field display the sum total of the field
'Net' for all instances of a given stock in a given account.

Any ideas ???

Thanks, Scott

2. Any Free MS SQL Server JDBC driver?

3. Creating unbound data grids

4. Q. how to get names (and structures?) of missing tables

5. Creating Multiple Subsets Using Replication

6. HELP: Switch from typed binary database to Access (mdb) .

7. Tool to create database subset?

8. Create and Sychronize subsets of your Oracle Database

9. Creating subset in same file

10. Creating a subset database file

11. which grid to use: DBGrid, data grid, MSFlexgrid