Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Where value is like field name

Results 1 to 4 of 4
Share This Thread →
  1. #1
    sweetorangepie's Avatar
    sweetorangepie is offline Contributing User
    Join Date
    Oct 2007
    Posts
    184
    Rep Power
    8

    Where value is like field name

    Hi Guys,

    I'm trying to write a query that looks at a value of a record and returns a value based on the name of the field. Basicly I have a language table that contains the days of the week in a number of diffrent languages, which has field names like DAY1 DAY2 ... DAY7 and another table that has a day field with the value like 1,2...7. What I want to achieve is to look at the name of the field and return its value.

    Does anyone know of a way to do this?

    Many Thanks
    On the off chance that I have been helpfull please click this

  2. #2
    sync_or_swim's Avatar
    sync_or_swim is offline Contributing User
    Join Date
    Mar 2006
    Location
    South Wales
    Posts
    3,674
    Rep Power
    2043
    I'm sorry I dont understand what you are trying to achieve. Any chance you could post a sample of your data so we can see what is going on?

  3. #3
    sweetorangepie's Avatar
    sweetorangepie is offline Contributing User
    Join Date
    Oct 2007
    Posts
    184
    Rep Power
    8
    Yeah it does sound pretty confusing, this is my data structure:

    Language Table:

    | LANG | DAY1 | DAY2 | DAY3 | etc
    | E | Mon | Tue | Wed |

    Store Table:

    | Some Data | Some Data | DAY |
    | DATA | DATA | 1 |

    So in this case I'd want to return the day 1 so the query would need to look at the field names of the language table and return the value where field is day1.

    Does this help?

    Thanks

  4. #4
    sweetorangepie's Avatar
    sweetorangepie is offline Contributing User
    Join Date
    Oct 2007
    Posts
    184
    Rep Power
    8
    I've wrote a query that describles what I want to do, it doesnt work of course but I've found the SQL keyword COLUMNS that sounds like it does what I want.
    Code:
    SELECT FLAT_CHOVERDAY FROM F_APARTMENTS, F_LANGUAGE WHERE (FLAT_CHOVERDAY LIKE COLUMS FROM F_LANGUAGE) AND (FLAT_CHOVERDAY = 1) ;
    What I want this to do is to return the value in the record of the F_LANGUAGE table where its column name is like that FLAT_CHOVERDAY field.

    Does this help at all?

    Thanks

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Change the Back Color of an Active Field
    By CorrieAnn in forum Microsoft Access Help
    Replies: 7
    Last Post: January 12th, 2005, 11:42 AM
  2. The form, the date field, his asp code, and her database!
    By wheeliecake in forum ASP Development
    Replies: 8
    Last Post: December 24th, 2004, 05:54 AM
  3. assign drop down menu item value to hidden field
    By maxtrixx in forum ASP Development
    Replies: 5
    Last Post: July 22nd, 2004, 01:48 PM
  4. Simple combo box/text box issue, difficult description (part 1)
    By etalent in forum Microsoft Access Help
    Replies: 1
    Last Post: March 29th, 2004, 05:16 PM
  5. Simple combo box/text box issue, difficult description (part 2)
    By etalent in forum Microsoft Access Help
    Replies: 0
    Last Post: March 29th, 2004, 04:15 PM

ASP Free Advertisers and Affiliates