Hi
I have a question for you... what if I have a table with different
field names as example Field1,Field2,Field3,Field4 and Field5.
I want to make only one query where I can run it and based on the user
request I need to show for example Field1,Field2 from the table. The
second run of the query, the use change his input and runs Field1,
Field3...so the query had to adapt to the user input and display
Field1 and Filed3 and sooo on.
The idea is instead of making for every possible input a query...I
need to make one query which can display the result based on the user
selection of Field names.
thanks for your help 1 1236
"Pathfinder" <pa*************@yahoo.com> wrote in message
news:ce**************************@posting.google.c om... Hi
I have a question for you... what if I have a table with different field names as example Field1,Field2,Field3,Field4 and Field5. I want to make only one query where I can run it and based on the user request I need to show for example Field1,Field2 from the table. The second run of the query, the use change his input and runs Field1, Field3...so the query had to adapt to the user input and display Field1 and Filed3 and sooo on. The idea is instead of making for every possible input a query...I need to make one query which can display the result based on the user selection of Field names.
maybe something like this:
parameters [col1] int, [col2] int;
select switch
(
[col1]=1, Field1,
[col1]=2, Field2,
[col1]=3, Field3,
[col1]=4, Field4
) as FirstColumn,
(
[col2]=1, Field1,
[col3]=2, Field2,
[col4]=3, Field3,
[col5]=4, Field4
) as SecondColumn
from foo This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jason Reljac |
last post by:
Howdy,
I have a table full of names, last & first, and I would like to do a SQL
select to get all of the last names that start with A-H
(I'll run another for I-P & Q-Z). The resulting last...
|
by: Matthew Braumiller |
last post by:
On Thu, 2 Oct 2003, "Gary Floam" <floam@comcast.net> wrote:
>Sure you can do that. The easies way is to create a table of the last names
>selected, and join that table into the query definition....
|
by: Colleyville Alan |
last post by:
I am trying to turn a short and fat (63 columns) table into one that is tall
and skinny (7 columns). Basically, I am trying to create a "reverse
crosstab" using a looping structure in VBA along...
|
by: Johnfcf |
last post by:
I have a database consisting of 3 tables, the main table with main
contact info, a second table with additional address info and a third
table consisting of additional contact information, or more...
|
by: HD |
last post by:
Hello. For the following, I would appreciate if anyone could tell me:
if it can be done, how it might done, and/or what search terms I could
use to find the solution myself.
I would like to...
|
by: Hanif Merali |
last post by:
Hello,
I'm having some difficulties creating a make table query. The source
table which I'm basing the make table query has the fields:
CIF
BusLine1-2001
BusLine1-2002
BusLine1-2003...
|
by: Ale K. |
last post by:
Hi, i'm designing my application that has a DLL that controls the Data
Layer, and another that Controls the Bussines Layer, at some point my
Bussines Layer need to Get an object ( Let's say a...
|
by: MP |
last post by:
Greets,
context: vb6/ado/.mdb/jet 4.0 (no access)/sql
beginning learner, first database, planning stages
(I think the underlying question here is whether to normalize or not to
normalize this...
|
by: Robert Dufour |
last post by:
In an english only application, it is fairly easy to make the table and
field names in your application descriptive so that on creating the
interface, most tools that bind data take the default...
|
by: Robert Dufour |
last post by:
In an english only application, it is fairly easy to make the table and
field names in your application descriptive so that on creating the
interface, most tools that bind data take the default...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
| |