indexing a view on several fields 
Author Message
 indexing a view on several fields

Hello group

I have a view called cisreports. I would like to index it for several
differnent reports. i.e. on the fields lastname,firstname
or
district,lastname,firstname
or
gradyear,lastname,firstname

How do I do this.

Thanks
Jim



Wed, 15 Dec 2004 05:16:47 GMT  
 indexing a view on several fields
Jim,
Views can have indexes just like any other "table", the only problem is that
they aren't persistant - you'll just have to create it (them) each time you
open the view.

Rick


Quote:
> Hello group

> I have a view called cisreports. I would like to index it for several
> differnent reports. i.e. on the fields lastname,firstname
> or
> district,lastname,firstname
> or
> gradyear,lastname,firstname

> How do I do this.

> Thanks
> Jim



Wed, 15 Dec 2004 06:24:41 GMT  
 indexing a view on several fields
Jim,
Of course as soon as I sent the first message, my brain said "but that's not
the question!". Since lastname and firstname are likely both character
fields, you can just concatenate them:
INDEX ON lastname+firstname TAG lastfirst

If district is a 3 digit number [i.e. N(3,0)], then you need to convert it
to a string:
INDEX ON STR(district, 3)+lastname+firstname TAG dslastfirst

Similar if gradyear is 4 digits:
INDEX ON STR(gradyear, 4)+lastname+firstname TAG grlastfirst

Finally if it was graddate (ie a date field), you'd want something like:
INDEX ON DTOS(graddate)+lastname+firstname TAG grdLastFir

Rick


Quote:
> Hello group

> I have a view called cisreports. I would like to index it for several
> differnent reports. i.e. on the fields lastname,firstname
> or
> district,lastname,firstname
> or
> gradyear,lastname,firstname

> How do I do this.

> Thanks
> Jim



Wed, 15 Dec 2004 06:36:35 GMT  
 indexing a view on several fields
Hi Rick

That was great!

Thanks
Jim

Quote:
> Jim,
> Of course as soon as I sent the first message, my brain said "but that's
not
> the question!". Since lastname and firstname are likely both character
> fields, you can just concatenate them:
> INDEX ON lastname+firstname TAG lastfirst

> If district is a 3 digit number [i.e. N(3,0)], then you need to convert it
> to a string:
> INDEX ON STR(district, 3)+lastname+firstname TAG dslastfirst

> Similar if gradyear is 4 digits:
> INDEX ON STR(gradyear, 4)+lastname+firstname TAG grlastfirst

> Finally if it was graddate (ie a date field), you'd want something like:
> INDEX ON DTOS(graddate)+lastname+firstname TAG grdLastFir

> Rick



> > Hello group

> > I have a view called cisreports. I would like to index it for several
> > differnent reports. i.e. on the fields lastname,firstname
> > or
> > district,lastname,firstname
> > or
> > gradyear,lastname,firstname

> > How do I do this.

> > Thanks
> > Jim



Wed, 15 Dec 2004 09:11:25 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Combining data from several fields into another field.

2. Combining data from several remote views into one report

3. reports in VFP50 on several fields

4. reports in FVP50 on several fields

5. reports in VFP5.0 on several fields

6. Remote view field defs WILL NOT match table field defs

7. BigInt fields in SQL - converted to Character fields in Remote View

8. views and index tags

9. Indexing and requirey/update views

10. Indexing VFP Database Views

11. View indexing

12. Creating an Index on a View???

 

 
Powered by phpBB® Forum Software