472,782 Members | 1,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 software developers and data experts.

Using a Select statment for the name of the field?

Do any of you know if it's possible to get the name of your field from
another table?

E.g.

Select FYear as [Select description from YearTable where category=1]

I need the name of the fields to be user defined and the only way I
can see this happening is through a table. But now...how do I get the
field name from the table?

Any help would be appreciated!!!!

Thank you,
Susan
Jul 20 '05 #1
2 1159

"sbligh" <sb****@canoemail.com> wrote in message
news:11**************************@posting.google.c om...
Do any of you know if it's possible to get the name of your field from
another table?

E.g.

Select FYear as [Select description from YearTable where category=1]

I need the name of the fields to be user defined and the only way I
can see this happening is through a table. But now...how do I get the
field name from the table?

Any help would be appreciated!!!!

Thank you,
Susan


Is this what you need?

select description as 'FYear'
from YearTable
where category=1

Or are you asking if you can store the name of a column or table to be
queried in a table? In that case, you would need dynamic SQL, but it's
generally not recommended:

http://www.sommarskog.se/dynamic_sql.html#Dyn_table

Simon
Jul 20 '05 #2
>> I need the name of the fields [sic] to be user defined .. <<

No, you need to learn to be a database programmer. A column -- which
is totally different from a field -- is a model for a data element.
If you let users define columns, they are designing the database on
the fly because you failed in your job.

If you just want a name for display, then do that in the presentation
layer, not in the database.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sylvia | last post by:
Hi, I'm trying to render a XML structure to HTML using XSLT. My XML describe the header of a table with a complex and not linear structure. The first row of the header table always contains the...
6
by: RCS | last post by:
I've been running into more and more complexity with an application, because as time goes on - we need more and more high-level, rolled-up information. And so I've created views, and views that use...
8
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE(...
0
by: elie chucrallah | last post by:
Dear Sirs, I have the following select query and i need to update the field EmailLastReceivedDate (showing null in the select) to the values in the field MaxOfSentOn using access 2000 query ...
2
by: Michele Fondry via .NET 247 | last post by:
hello. I have a webform form app in vb.Net that uses a SQL query. I am trying to use the substring function, but get the following error: Description: An unhandled exception occurred during the...
1
by: Anton Nikiforov | last post by:
Dear All, could you please help me with writing select statment for the following: I have two tables dictionary_text label| Text -----+------------------------ 23 | General 24 | Internet...
10
by: William Krick | last post by:
I am writing an XSL transform that converts XML data about vehicles into XML data that will fill printed forms. The default form can handle up to 5 vehicles which I handle using subscripts... ...
5
by: vsteshenko | last post by:
Hello, This is my second post to the any usernet group and the first one was posted to the wrong one. I am currently working on creating an order form for sales associates at my work to be used...
1
by: Steffen Stellwag | last post by:
Truely is often better to scan a table in full passing by an index , but if you can force the optimizer to use an index via a hint for testing and comparing the results. But the index in the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.