I get extracts/reports from a corporate Sybase database. This is a
very very large transactional database, very little (or slow and
complex) reports/queries, so instead I have an all-inclusive query
run, dropped into a folder each night, and then do my data
analysis/mining via Access.
Now here's my problem
The DATA (stored as a Trait) is not stored in separate fields for each
trait .. here's an example
Identifier Trait_Name Trait_Value
12345 SeedNumber 147
12345 HarvestDate 4/15/2005
12345 Status Harvested
etc
There may be many rows for each identifier... as many rows as there
are unique trait and trait values assocaited with each identifier. Of
course the Trait_Value field is character.
Now what I want to do is to build a crosstab so that the data looks
like this..each identifier a row, each Trait_Name gets a field name
and the trait_values are converted to numeric, date or character to
conform to the type of data they are. I will have a separate field
for each Trait I want to use.
Identifier SeedNumber HarvestDate Status
12345 147 4/15/2005 Harvested
12346
12347 23 5/20/2001 Harvested
12348 Killed
This is what I have so far
in Access2003, QBE window, I built this
Identifier Seed:Iff([Trait_Name]="SeedNumber ",[Trait_Value],"") etc
Group by First
So is this the correct way to do this? And how might I convert the
information to the correct format (Date, numeric).... I presume use
format()?
Maybe there's a way to more easily (and powerfully?) do this in SQL?
If so, I will have to learn that now as well.
Thanks
Jerry
very very large transactional database, very little (or slow and
complex) reports/queries, so instead I have an all-inclusive query
run, dropped into a folder each night, and then do my data
analysis/mining via Access.
Now here's my problem
The DATA (stored as a Trait) is not stored in separate fields for each
trait .. here's an example
Identifier Trait_Name Trait_Value
12345 SeedNumber 147
12345 HarvestDate 4/15/2005
12345 Status Harvested
etc
There may be many rows for each identifier... as many rows as there
are unique trait and trait values assocaited with each identifier. Of
course the Trait_Value field is character.
Now what I want to do is to build a crosstab so that the data looks
like this..each identifier a row, each Trait_Name gets a field name
and the trait_values are converted to numeric, date or character to
conform to the type of data they are. I will have a separate field
for each Trait I want to use.
Identifier SeedNumber HarvestDate Status
12345 147 4/15/2005 Harvested
12346
12347 23 5/20/2001 Harvested
12348 Killed
This is what I have so far
in Access2003, QBE window, I built this
Identifier Seed:Iff([Trait_Name]="SeedNumber ",[Trait_Value],"") etc
Group by First
So is this the correct way to do this? And how might I convert the
information to the correct format (Date, numeric).... I presume use
format()?
Maybe there's a way to more easily (and powerfully?) do this in SQL?
If so, I will have to learn that now as well.
Thanks
Jerry
Comment