473,416 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Can I label the output column resulting from a SELECT query with a variable

Can I lable the output column resulting from a SELECT query with a variable from one of the tables which are the source of the data? I know I can hard code the lables in the SELECT statement but since the actual data will not always be “ ˝ nuts”, for instance, I want the column to be called whatever is in that field.

I am not sure I have been clear here…hoping so!

In other words, if I have a table containing

Column Name |Data
Data1 |1/2 inch nuts
Data2 |3/8 inch bolts
Stock1 |0.08
Stock2 |0.12


Normal SQL SELECT query result
Data1 |Data2 |Stock1 |Stock2
0.0800 |0.1200 |0.08 |0.12

Desired SQL SELECT query result
1/2 inch nuts |3/8 inch bolts
0.0800 |0.1200

Many Thanks!
CBJ
Apr 10 '10 #1
1 3312
Delerna
1,134 Expert 1GB
Not without some tricky dynamic sql which, judging from what I see in your question, could be very tricky indeed.
Apr 12 '10 #2

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

Similar topics

6
by: deko | last post by:
Can I reference a column other than the bound column of a ComboBox in a query? SELECT ... WHERE CtlID = Forms!frmMain!cbxCtlID.Column(1); (this does not seem to work) Or must I add a hidden...
0
by: Jean | last post by:
Hi all, This problem has me dumbstruck at the moment and I was wondering if someone could offer some advice while I have a go at it myself. Background: I have a query qryAll that takes data...
1
by: geronimo_me | last post by:
Hi, I have a query that has the following fields: Business: ID Number: LastName: EmpNo: Hours1: Hours2:
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
1
by: Phil | last post by:
Is it possible to swap rows and columns in select query output so that each record's data is displayed in a column? I want to collect data each day and display it in a query with each day's date...
1
by: steveyell | last post by:
Hi there, I have a database with 90,000 property records and I need to split the database into 5 geographic areas. Those areas are defined by postcode districts, and a number of postcode...
2
by: Roobmeister | last post by:
Hi, I am new to Oracle, and can't find the answer for this anywhere. I have a giant SELECT query for a data extract that includes many subqueries. I would like to limit the data being queried...
4
by: sonu2die4 | last post by:
Hi, I have the following perl script working for me.I am accesing the database from my perl script using use Net::Telnet(); package. I am not using DBI package.as I stated earlier the following...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.