473,503 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

special query

Hi NG

I need to create a query wich shows me several fields of one record in
several records - in access97.

Well, here's an example:

ok, that's my table:

UniqeNumber Item1 Item2 Item3
123456789 ABC AFF GRR
987654321 EFF ABC ELB
And my query should look like this:
UniqeNumber Item
123456789 ABC
123456789 AFF
123456789 GRR
987654321 EFF
987654321 ABC
987654321 ELB
I tried different ways with creating an own field and entered in the
expression: "item: [item1] or [item2] or [item3]" --> This only shows
me that there is a value in one of those fields. The same with "and",
here it shows me that there is a value in all fields. I even trief to
put the records in several tables and put them together - but that
don't work too.

Do you have any Ideas how to solve this? I can't change the table
definition, because it's an already full working software.

Thanks a lot for your help

susanna
Nov 12 '05 #1
3 1360
Susanna,

You need to change your table to this:

TblItems
ItemID
ItemDesc
ItemNum

"Item1", "Item2" and :Item3" go in ItemDesc and UniqueNumber goes in ItemNum.

Your problem then goes away and creting the query you want is a piece of cake!

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"SusannaW" <su******@gmx.net> wrote in message
news:1f*************************@posting.google.co m...
Hi NG

I need to create a query wich shows me several fields of one record in
several records - in access97.

Well, here's an example:

ok, that's my table:

UniqeNumber Item1 Item2 Item3
123456789 ABC AFF GRR
987654321 EFF ABC ELB
And my query should look like this:
UniqeNumber Item
123456789 ABC
123456789 AFF
123456789 GRR
987654321 EFF
987654321 ABC
987654321 ELB
I tried different ways with creating an own field and entered in the
expression: "item: [item1] or [item2] or [item3]" --> This only shows
me that there is a value in one of those fields. The same with "and",
here it shows me that there is a value in all fields. I even trief to
put the records in several tables and put them together - but that
don't work too.

Do you have any Ideas how to solve this? I can't change the table
definition, because it's an already full working software.

Thanks a lot for your help

susanna

Nov 12 '05 #2

"SusannaW" <su******@gmx.net> wrote in message
news:1f*************************@posting.google.co m...
Hi NG

I need to create a query wich shows me several fields of one record in
several records - in access97.

Well, here's an example:

ok, that's my table:

UniqeNumber Item1 Item2 Item3
123456789 ABC AFF GRR
987654321 EFF ABC ELB
And my query should look like this:
UniqeNumber Item
123456789 ABC
123456789 AFF
123456789 GRR
987654321 EFF
987654321 ABC
987654321 ELB
I tried different ways with creating an own field and entered in the
expression: "item: [item1] or [item2] or [item3]" --> This only shows
me that there is a value in one of those fields. The same with "and",
here it shows me that there is a value in all fields. I even trief to
put the records in several tables and put them together - but that
don't work too.

Do you have any Ideas how to solve this? I can't change the table
definition, because it's an already full working software.

Thanks a lot for your help


You should really change the table, but if you can't you can use a union
query. A union query can't be built in design view... you must use SQL
view.

Where the table name is "Items" the union query would look like:

SELECT Items.UniqeNumber, Items.Item1 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumber, Items.Item2 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumber, Items.Item3 AS ItemNo
FROM Items;

--
Steve Heath
Nov 12 '05 #3
Hi Steve
Thanks a lot, UNION SELECT worked very well.... :o) Excactly as I needed!
Greets
Susanna

"Steve Heath" <st***************@sbcglobal.net> wrote in message news:<de*******************@newssvr31.news.prodigy .com>...

You should really change the table, but if you can't you can use a union
query. A union query can't be built in design view... you must use SQL
view.

Where the table name is "Items" the union query would look like:

SELECT Items.UniqeNumber, Items.Item1 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumber, Items.Item2 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumber, Items.Item3 AS ItemNo
FROM Items;

Nov 12 '05 #4

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

Similar topics

12
28545
by: Mosher | last post by:
Hi all, I have an issue with php and/or mysql. I have a php form that writes "items" to a mysql database, including a description of the item. On the mysql server, "magic_quotes_gpc" is ON. I...
4
5241
by: Ewok | last post by:
let me just say. it's not by choice but im dealing with a .net web app (top down approach with VB and a MySQL database) sigh..... Anyhow, I've just about got all the kinks worked out but I am...
0
1725
by: noor | last post by:
Hi I'm working on linked server which uses db2oledb. When I tried simple select query it didn't ran because the queries condition was based on column having special character. Query was like that...
3
651
by: SMG - Idealake | last post by:
Hi All, I have created an application which is working fine and is in about to launch, now suddenly my mgmt says there are chances that Scrip ID( a particular id and not prim key) may have special...
8
3639
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
4
5969
by: kenneth.osenbroch | last post by:
Hi, I have a MSSQL Server communicating with an Oracle database through a MSSQL linked server using a MS ODBC connection. If I query the Oracle database through the Oracle ODBC 32Bit Test, the...
3
4155
by: jefftyzzer | last post by:
Friends: I have a stored procedure declared as: CREATE PROCEDURE X.Y LANGUAGE SQL DYNAMIC RESULT SETS 1 READS SQL DATA SPECIFIC Y INHERIT SPECIAL REGISTERS
0
1694
by: dearsaran | last post by:
Hi, I Want a function written for finding the special characters in a emailid.. Suppose, i've a column email in a table and inserting a emailid with any of the special characters then if i...
1
1512
by: Ragavendran | last post by:
Hi, I am using this method for search: Query =org.apache.lucene.queryParser.QueryParser.parse(String arg0) throws ParseException Hits = org.apache.lucene.search.Searcher.search(Query query,...
5
11145
by: Sobin Thomas | last post by:
Hi All, I want to pass a string that contains many special characters (: \ . _ etc) to another page in my website through query string. In my project I have a Gridview control ,in which there...
0
7064
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
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
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...
1
6974
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
7445
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
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.