salgergawi
Registered User.
- Local time
- Today, 05:11
- Joined
- Sep 28, 2013
- Messages
- 23
Hello,
I need an idea to help to create an cross table I have done an normal query and from the query i need to do an cross query.
The first Query which will be call for the crosstab contain:
Code
col1 | col2 | col3 | col4
Unite_Name |Attacking |Defenseing |Nothing
what i need in the crosstab to get the Columns and Rows with Unite_Name
and the values of (Attacking, Defenseing & Nothing) to be fill in the table as the follwing
if Attacking value is true to set Value Att
if Defenseing value is true to set Def
if Nothing value is true to set NA
my code is:
I need an idea to help to create an cross table I have done an normal query and from the query i need to do an cross query.
The first Query which will be call for the crosstab contain:
Code
Code:
SELECT Estebak.Attacking, Estebak.Defenseing, Estebak.Nothing, Unites_Name.Unite_Name
FROM (Attack LEFT JOIN Estebak ON Attack.ID = Estebak.attack_id) LEFT JOIN Unites_Name ON Attack.Unite_ID = Unites_Name.Unite_ID;
Unite_Name |Attacking |Defenseing |Nothing
what i need in the crosstab to get the Columns and Rows with Unite_Name
and the values of (Attacking, Defenseing & Nothing) to be fill in the table as the follwing
if Attacking value is true to set Value Att
if Defenseing value is true to set Def
if Nothing value is true to set NA
my code is:
Code:
TRANSFORM Query1.Unite_Name
SELECT Query1.Attacking
FROM Query1
GROUP BY Query1.Unite_Name
PIVOT Query1.Attacking;