Select query

G

gmenon100

Dear friends,

I have a tblContact with 60 colums. I need to extract say column 3 based on
value(202) in column 4, and 7 based on value (202) in colum 8 and column 11
based on value (202) in colum 12 -- into a new table.

Is this possible and if so could I acheive this.

My table is as under

field1 field2 field3 field4 field5 field6 field7 field8
field9 field10 field11 field12
John 8888 4500 202 Keith Tom Dental 503 NY
queens 6589 202
Patty 9287 7666 449 Jerry Kay heart 202 NJ
Jer Cit 8733 543
Gale 8376 7555 202 Kelly Nath Ear 202 NJ
Bronx 3300 122


Since the value to be extracted is (202)

the data should be :

field1 field2 field3 field4 field5 field6 field9 field10
John 8888 4500 202 Keith Tom NY queens
John 8888 6589 202 Keith Tom NY queens
Patty 9287 heart 202 Jerrt Kay NJ Jer Cit
Gale 8376 7555 202 Kelly Nath NJ Bronx
Gale 8376 Ear 202 Kelly Nath NJ Bronx


Can anyone please help.

Thank you in advance.

Gimen
 
J

Jeff Boyce

A table with "60 columns" is probably ... a spreadsheet!

Access is a relational database ... you won't get easy use of Access'
features/functions if you feed it 'sheet data.

Based on your description, your current tblContact!Field3 can contain
numbers (4500, 6589, 7555) or text (heart, ear).

This is not a well-normalized design.

Since it all starts with the data, you may need to clean up your data before
you can (easily) use Access' query features.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

Dear friends,

I have a tblContact with 60 colums. I need to extract say column 3 based on
value(202) in column 4, and 7 based on value (202) in colum 8 and column 11
based on value (202) in colum 12 -- into a new table.

Is this possible and if so could I acheive this.

My table is as under

field1 field2 field3 field4 field5 field6 field7 field8
field9 field10 field11 field12
John 8888 4500 202 Keith Tom Dental 503 NY
queens 6589 202
Patty 9287 7666 449 Jerry Kay heart 202 NJ
Jer Cit 8733 543
Gale 8376 7555 202 Kelly Nath Ear 202 NJ
Bronx 3300 122


Since the value to be extracted is (202)

the data should be :

field1 field2 field3 field4 field5 field6 field9 field10
John 8888 4500 202 Keith Tom NY queens
John 8888 6589 202 Keith Tom NY queens
Patty 9287 heart 202 Jerrt Kay NJ Jer Cit
Gale 8376 7555 202 Kelly Nath NJ Bronx
Gale 8376 Ear 202 Kelly Nath NJ Bronx

I really don't understand the logic of your tblContact. I gather that you're
trying to normalize it, but I don't understand how the 202 in Field4 and the
202 in ... what, Field12? word wrap obscured it... relate to the rest of the
data. Is there internal structure within this 60 field record?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top