473,651 Members | 3,063 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 1375
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******@pcdata sheet.com
www.pcdatasheet.com

"SusannaW" <su******@gmx.n et> wrote in message
news:1f******** *************** **@posting.goog le.com...
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.n et> wrote in message
news:1f******** *************** **@posting.goog le.com...
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.UniqeNumb er, Items.Item1 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumb er, Items.Item2 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumb er, 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.n et> wrote in message news:<de******* ************@ne wssvr31.news.pr odigy.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.UniqeNumb er, Items.Item1 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumb er, Items.Item2 AS ItemNo
FROM Items;

UNION SELECT Items.UniqeNumb er, 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
28572
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 am testing it now by putting special characters in the description field, this is what I am entering: O'Leary "special edition"
4
5257
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 having trouble preserving data as it gets entered into the database. Primarily, quotes and special characters. Spcifically, I noticed it stripped out some double quotes and a "Registered" symbol &reg; (not the ascii but the actual character"
0
1733
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 select * from openquery(as400prod,'SELECT * FROM RMSPROD.RTIUPF WHERE IUDOC# = 2705') I was getting SQLState: 42703, sqlcode: -206
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 characters like '&,*,) or /' This data(field/key) I am passing this value as a querystring. e.g. value to be passed : ABC http://localhost/myProj/abc.aspx?ScripID=ABC
8
3656
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 and save it to a file. This step is not to hard however the contents of the textarea is mostly latex source so it contains just about every special character you can imagine. My question is this, how do I save an exact copy of the textarea...
4
5994
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 result is fine: select addrsurname from address where addrnr = 6666; HÅKANSSON
3
4162
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
1705
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 compile the funtion then it should show the wrong emailid's Example: If a emailid is dear#$saran@gmail!#$%.com then 1st it should check any special char from 1st letter to '@' and one more condition is after @ is there any sepcial char(even space is...
1
1521
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, Sort sort) throws IOException Problem : I cant able to search the word. If the word contain special character like , %BF It just taken that special character a empty space and search the remaining character
5
11152
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 is a hyperlink field.The Gridview 's datasource is set as a database table at runtime.The hyperlink filed's DataNavigateUrlFields is set to "RecordID" ,which is a field in my database table.The RecordID field contains many special characters.I...
0
8361
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8278
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6158
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.