Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i am trying to transform data in ac

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
i am trying to transform data in access DB this way:
year month1 month2 month3
1980 x y z
1982 a b c

transform to:
year monts 1-12
1980 x
1980 y
1980 z
1982 a
1982 b
1982 c

please help me, what is the sql statement , or access design??? Thank you
I got advice to use union , but what is the syntext in access?

 
Here ya go...

select
year,
month1 as months
from
TableName

union all

select
year,
month2
from
TableName

union all

select
year,
month3
from
TableName
order by
year,
months
 
thank you it works!
However , i have a problem with the sort,
i want to sort it by mounts , but - not by the value in that month but by the order of months
Ex :

year months
1980 -7 (this is first because it jan value)
1980 767 (this is first because it Feb value)
1980 55 (this is first because it March value)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top