×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to arrange the values in column heading based on column STT

How to arrange the values in column heading based on column STT

RE: How to arrange the values in column heading based on column STT

It is hard (at least for me) to decipher what you actually need.

The best way to ask is to state:
* This is what I have now:
(show an example of what you have)
* And this is what I want to have:
(show an example of what you would like to have based on the above example)

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: How to arrange the values in column heading based on column STT

(OP)
Hi Andrzejek,
Thanks for your reply.
If you open tableA : column STT from 1-70,
column colcot with the 12 values(Ngọ,Mùi,Thân,Dậu,Tuất,Hợi,Tý,Sửu,Dần,Mão,Thìn,Tị)
column rowHang Based on STT: from 1 to 12 should be row 1: rowHang
Thái Tuế , Thiếu Dương ,Tang Môn,Thiếu Âm,Quan Phù , Tử Phù ,Tuế Phá ,Long Đức ,Bạch Hổ , Phúc Đức,Điếu Khách, Trực Phù.

The attachment for yr ref.

I want Query1 should be arranged as the picture above. However the query1 output differ as belows:

RE: How to arrange the values in column heading based on column STT

Really convoluted requirement, but what I've got from it is this:

This is the data you have:


And this is the first record you want to create:


So you want to pick these values from your original data and make it into one (first) record:


Is that what you want to do ponder

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: How to arrange the values in column heading based on column STT

(OP)
This is the data you have: => This data, I have typed by manual.
I want the data output like as belows:

RE: How to arrange the values in column heading based on column STT

I am sorry, I cannot help you because I don't understand your requirements
Maybe somebody else jumps in to take over...

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: How to arrange the values in column heading based on column STT

I've been following this thread, wondering how Andy was going to figure out your requirements. Gathering user requirements and writing logical specifications for programmers was something I did for over 30 years in the aircraft industry.

Neither Andy nor I can discover the logic behind the visual example you posted. If I believed that this is what you really needed, and I do, I would tell you that this was an illogical requirement that I could not help you with.

We need a clear, cogent and concise explanation of your requirements. You have failed on all three.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!

RE: How to arrange the values in column heading based on column STT

(OP)
Hi SkipVought,
After a few days, I added a column "Sxep" into TableA then results out is ordered.
However results of Query "Qxep" quite Ok. But It is missing compare with query 1
Can you check and reply with new query to outputs with all data instead of missing
Pls find the attachment for your ref.
Your file's link is: https://files.engineering.com/getfile.aspx?folder=...

RE: How to arrange the values in column heading based on column STT

(OP)
Hi everyone,
after a few days with my best, I found a solution for the issue.
How to order the values by STT in column headings ?
Only you create relationship with a little tip.

Results is good for your best.
Thank you.

RE: How to arrange the values in column heading based on column STT

If the target is to have columns ordered by STT ('if' - as there are no gaps only in your initial table), then:

1. create support query, named 'q_Position':

CODE --> Access_SQL

SELECT A_1.Cdem, A_1.rowHang, A_1.colcot, A_1.STT, Count(A_2.colcot) AS PosID
FROM TableA AS A_1 INNER JOIN TableA AS A_2 ON A_1.colcot = A_2.colcot
WHERE (((A_2.STT)<=[A_1].[STT]))
GROUP BY A_1.Cdem, A_1.rowHang, A_1.colcot, A_1.STT; 
and next final crosstab query:

CODE --> Access_SQL

TRANSFORM Min(q_Position.rowHang) AS MinOfrowHang
SELECT q_Position.PosID
FROM q_Position
GROUP BY q_Position.PosID
PIVOT q_Position.colcot; 
The result:



combo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close