Computer Hope

Software => Computer software => Topic started by: JAgosta on July 10, 2012, 09:51:01 AM

Title: excel query assistance
Post by: JAgosta on July 10, 2012, 09:51:01 AM
Hello esteemed users -
I have a spreadsheet with various cells and want to create a dynamic query to access a backend dictionary table based on the value of certain cells and insert into another tb.
For example, in the following:

EID or PID    PhyNum   Web   Red   Blu   Gre   Sil
5000418    p97582     x    x    x    x    x
5000419    p97584     x    x    x    x    x
5000420    p97583     x    x    x    x    x
5000421    p97585     x    x    x    x    x
5000422    p97586     x        x        x

EID, PID relate to CPK_WORKGROUP_ID
web, red, blu, gre, sil relate to C_DESC column

I want to query a table / insert to another.

Tables are:
tworkgroup (dictionary):
  CPK_WORKGROUP_ID
  C_DESC         
  C_CREATED_TS   

tworkgroupreqister:
  CPK_WORKGROUP_ID 
  CPK_USERID       
  C_WORKGROUP_ADMIN


Query is:

insert into db21sql.tworkgroupregister
select cpk_workgroup_id, '<PhyNum from xls>', 0
  from db21sql.tworkgroup
 where upper(c_desc) like '%SILVER%'; (or web, red, blu, gre for each with an 'x')

Is this doable? or am I up a tree  ???

TIA,
Jeff A



[year+ old attachment deleted by admin]
Title: Re: excel query assistance
Post by: soybean on July 12, 2012, 05:59:33 AM
When I think of tables and queries, I think of Access, not Excel.  So, I'll just suggest you consider using Access.  But, for help with Excel, you can find some Excel-specific forums by doing a search on excel forum.
Title: Re: excel query assistance
Post by: JAgosta on July 12, 2012, 09:52:22 AM
Thanks Soybean -
The users submit the xls to us. My role is to add them to the back-end tables based on the data. I do certainly agree that  access would be a 'better' choice, but can't affect that change.  :-X

Tku,
Jeff a