By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

Help retrieving values from table row+column header

matrekz42
P: 33
Good Afternoon,

I'm trying to query the following:

I have a table that has a row name and then a specific column name for that given row name.

Expand|Select|Wrap|Line Numbers
  1. (row)
  2. Rate  Segment Segment2
  3. 1        56      5
  4. 2        90      12
  5. 3        100     15
  6. 4        25      45
  7. 5        13      2
I have a query that will return the following values as independent fields, showing record 'x' = Rate1, Segment2...

How can I show the value of the Column 'Segment2' = 5 for Rate1?

I've tried Dlookup's, etc, but no success. Any help/suggestions is greatly appreciated.
Feb 28 '12 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,610
  1. SQL assuming Table Name is Table1 and Results Field is named [Result]:
    Expand|Select|Wrap|Line Numbers
    1. SELECT "Segment2=" & [Segment2] & " for Rate " & [Rate] As [Result]
    2. FROM Table1;
    3.  
  2. OUTPUT:
    Expand|Select|Wrap|Line Numbers
    1.         Result
    2. Segment2=5 for Rate 1
    3. Segment2=12 for Rate 2
    4. Segment2=15 for Rate 3
    5. Segment2=45 for Rate 4
    6. Segment2=2 for Rate 5
    7.  
Feb 29 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.