Column values in table equal column names in other table (unpivot? cross apply?)

2 tables:
CREATE TABLE Requirement
 reqID int IDENTITY(1,1) PRIMARY KEY,
 req_result_id numeric(10,0) NOT NULL,
 description varchar(200),
 heading varchar(100),
 GO
INSERT INTO Requirement VALUES (5296,'Cold pack','HH19_5');
INSERT INTO Requirement VALUES (5296,'Band-Aids','HH19_6');
INSERT INTO Requirement VALUES (5296,'First aid cream','HH19_7');
INSERT INTO Requirement VALUES (5296,'Tape','HH19_8');
INSERT INTO Requirement VALUES (5296,'Gloves','HH19_9);
INSERT INTO Requirement VALUES (5296,'Bandages','HH19_10');
INSERT INTO Requirement VALUES (5296,'Hand sanitizer','HH19_11');
INSERT INTO Requirement VALUES (5296,'Scissors','HH19_12');
INSERT INTO Requirement VALUES (5296,'Poison control information','HH19_13');
INSERT INTO Requirement VALUES (5296,'Name','HH02');
GO
CREATE TABLE Response
 respID int IDENTITY(1,1) PRIMARY KEY,
req_result_id numeric(10,0) NOT NULL,
 HH02 varchar(200),
 HH19_5 varchar(20),
 HH19_6 varchar(20),
 HH19_7 varchar(20),
 HH19_8 varchar(20),
 HH19_9 varchar(20),
 HH19_10 varchar(20),
 HH19_11 varchar(20),
 HH19_12 varchar(20),
 HH19_13 varchar(20),
 GO
INSERT INTO Response VALUES (33,'Mary',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (35,'Barbara',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (144,'Melissa',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (146,'Missy',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (5296,'Pamela',7,8,9,10,11,12,13,14,15);
GO
Result:
description
heading
response
Name
HH02
Pamela
Bandages
HH19_10
12
Hand sanitizer
HH19_11
13
Scissors
HH19_12
14
Poison control information
HH19_13
15
Cold pack
HH19_5
7
Band-Aids
HH19_6
8
First aid cream
HH19_7
9
Tape
HH19_8
10
Gloves
HH19_9
11
For now, I'm using where req_result_id = 5296. Only one row from the Response table is selected.
I'm playing with unpivot and cross apply. I might use two CTE's but am not yet sure how to join them. I would just like to see what others here suggest.
I only need help with T-SQL - not table design.
Let me know if you need more info or if I need to reformat the expected output to make it legible.
Thanks for any suggestions.

CREATE TABLE Requirement
reqID int IDENTITY(1,1) PRIMARY KEY,
req_result_id numeric(10,0) NOT NULL,
description varchar(200),
heading varchar(100),
GO
INSERT INTO Requirement VALUES (5296,'Cold pack','HH19_5');
INSERT INTO Requirement VALUES (5296,'Band-Aids','HH19_6');
INSERT INTO Requirement VALUES (5296,'First aid cream','HH19_7');
INSERT INTO Requirement VALUES (5296,'Tape','HH19_8');
INSERT INTO Requirement VALUES (5296,'Gloves','HH19_9');
INSERT INTO Requirement VALUES (5296,'Bandages','HH19_10');
INSERT INTO Requirement VALUES (5296,'Hand sanitizer','HH19_11');
INSERT INTO Requirement VALUES (5296,'Scissors','HH19_12');
INSERT INTO Requirement VALUES (5296,'Poison control information','HH19_13');
INSERT INTO Requirement VALUES (5296,'Name','HH02');
GO
CREATE TABLE Response
respID int IDENTITY(1,1) PRIMARY KEY,
req_result_id numeric(10,0) NOT NULL,
HH02 varchar(200),
HH19_5 varchar(20),
HH19_6 varchar(20),
HH19_7 varchar(20),
HH19_8 varchar(20),
HH19_9 varchar(20),
HH19_10 varchar(20),
HH19_11 varchar(20),
HH19_12 varchar(20),
HH19_13 varchar(20),
GO
INSERT INTO Response VALUES (33,'Mary',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (35,'Barbara',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (144,'Melissa',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (146,'Missy',7,8,9,10,11,12,13,14,15);
INSERT INTO Response VALUES (5296,'Pamela',7,8,9,10,11,12,13,14,15);
GO
;with mycte as (
select respID,req_result_id,response,heading from Response
cross apply (values
([HH19_5],'HH19_5')
,([HH19_6],'HH19_6')
,([HH19_7],'HH19_7')
,([HH19_8],'HH19_8')
,([HH19_9],'HH19_9')
,([HH19_10],'HH19_10')
,([HH19_11],'HH19_11')
,([HH19_12],'HH19_12')
,([HH19_13],'HH19_13')
,([HH02],'HH02') ) d(response,heading)
WHERE req_result_id=5296 )
select description,r.heading,response from Requirement r
inner join mycte m on r.req_result_id=m.req_result_id and r.heading=m.heading
Order by Case When len(r.heading)=4 then 1 Else 2 END, Len(Replace(r.heading,'HH19_','')) desc
drop table Requirement,Response

Similar Messages

  • Print out a column value only if another column has a specific value (CASE Statement)

    Hello all,
    I tried many hours to find a solution for the following request but wasn't successful. Maybe you could help me.
    I've using the already existing SQL Views in Microsoft Service Manager to do some basic reporting about my tickets.There is no closed date in the activity tickets so I decided to print out the lastmodified timestamp when the status is "closed".
    That's my query:
    SELECT DISTINCT
    dbo.DisplayStringView.DisplayName AS Status,
    CASE WHEN dbo.DisplayStringView.DisplayName = 'Closed' THEN dbo.DisplayStringView.LastModified ELSE 'NO CLOSED Date' END AS ClosedDate
    FROM dbo.MTV_System$WorkItem$Activity$ManualActivity LEFT OUTER JOIN
    dbo.DisplayStringView ON dbo.MTV_System$WorkItem$Activity$ManualActivity.Status_8895EC8D_2CBF_0D9D_E8EC_524DEFA00014 = dbo.DisplayStringView.LTStringId
    Unfortunatelly I'm not getting the value from dbo.DisplayStringView.LastModified. SQL outputs that it is not possible to convert the string to date/time.
    I think there is a problem with the CASE statement in combination with a value select.
    Any ideas how to print out a column value only if another column has a specific value?

    I think it is the other way if you want the missing date shown as a string.
    CASE
    WHEN
    dbo.DisplayStringView.DisplayName
    =
    'Closed'
    THEN
    Convert( varchar(10),dbo.DisplayStringView.LastModified
    , 101) ELSE
    'NO CLOSED Date'
    END
    AS
    ClosedDate 

  • How to fetch the Alias column values based on different column values?

    Hello Gurus,
    I have a table with the following struture -
    "drop table T;
    create table T(Name, Symbol, Amount,dep) as select
    'Anderia', 'AA', 1050000,'HR' from dual union all select
    'Michael', 'ML',150000,'Sales' from DUAL union all select
    'Bill', 'BL', 1050000,'Finance' from dual union all select
    'Nancy', 'NY', 4000,'HR' from DUAL union all select
    'Anderia', 'AA',3000,'HR' from dual union all select
    'Michael', 'ML',1050000,'Sales' from DUAL union all select
    'Bill', 'BL', 1200000,'Finance' from DUAL union all select
    'Anderia', 'AA', 1200000,'HR' from DUAL union all select
    'Vish', 'VH', 1200000,'Marketing' from DUAL;"Ans try to find out the values of the column like
    Name,symbol,dep,Amount,%Total,$Cumm Total, Rank but some additional columns like -
    HR Amount, %HRTotal,$HR Cumm Total,
    Finance Amount, %FinanceTotal,$Finance Cumm Total
    Sales Amount, %SalesTotal,$Sales Cumm Total,
    Marketing Amount, %MarketingTotal,$Marketing Cumm Total
    then i am using the following query to fetch the Name,symbol,dep,Amount,%Total,$Cumm Total, Rank columns -
    select name
         , decode(grouping(symbol), 0, symbol, 'Total') symbol
         , dep
         , sum(amount) amount
         , sum(per_total) "% Total"
         , decode(grouping(symbol), 0, max(Cum_per_total), null) "% Cumm Total"
         , decode(grouping(symbol), 0, max(rank), null) rank
      from (
              select name
                   , symbol
                , dep
                   , amount
                   , per_total
                   , sum(per_total) over(order by rk) cum_per_total
                   , rank
                   , rk
                from (    
                        select name
                             , symbol
                    , dep
                             , sum(amount) amount
                             , round((sum(amount)/max(total_amount)) * 100,2) per_total
                             , dense_rank () over (order by sum(amount) desc) as rank
                             , row_number() over(order by sum(amount) desc) as rk
                          from (
                                 select name
                                      , symbol
                                      , amount
                          , dep
                                      , sum(amount) over() total_amount
                                      , sum(amount) over ()
                                   from t
                         group
                            by name, symbol, dep
      group        
         by grouping sets((name, symbol, dep), ())
      order by rank, max(rk) nulls lastBut i want to fetch the following columns as well.......how can i do it?-
    HR Amount, %HRTotal,$HR Cumm Total,
    Finance Amount, %FinanceTotal,$Finance Cumm Total
    Sales Amount, %SalesTotal,$Sales Cumm Total,
    Marketing Amount, %MarketingTotal,$Marketing Cumm Total
    as i want all of the records, then going to specific to the dep.....do i need to use the case here?
    Thanks for all of your time and effort in advance

    Hello Frank Kulash/Łukasz Mastaler,
    Thanks for your time and effort.
    I am using the Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    I am looking forward to have some additional columns (column alias) along with the the returned by the mentioned query - which are named as -
    1- HR Amount
    2- %HRTotal
    3- %HR Cumm Total
    4- Finance Amount
    5- %FinanceTotal
    6- %Finance Cumm Total
    7- Sales Amount
    8- %SalesTotal
    9- %Sales Cumm Total
    10 -Marketing Amount
    11- %MarketingTotal
    12- %Marketing Cumm Total
    based on the logic like -
    HR Amount = sum of amount case dep ='HR'
    %HR Total = % of amount case dep ='HR'
    %HR Cumm Total (cumulative % based on the cumulative total of %HR Total) = Cumm % of amount case dep ='HR'
    similarly rest of the column........
    Now how do i use case with a logic so that it returns me the columns as i want them ...using the above mentioned query .......
    Kindly help me .....thanks in advance for all of your time

  • How to store all the columns values into one single column

    Hi All,
    this is my file layout,i am receiving the data in below format only
    emp_no,c1,c2,c3,c4,c5
    100 ,1 ,0 ,1 ,0,1
    200 ,1 ,0 ,1 ,0,1
    300 ,1 ,0 ,1 ,0,1
    but i want to store that above data into my table like(from c1 to c5 columns values i want to store in period column)
    emp_no,period
    100 ,1
    100 ,0
    100 ,1
    100 ,0
    100 ,1
    200 ,1
    200 ,0
    200 ,1
    200 ,0
    200 ,1
    300 ,1
    300 ,0
    300 ,1
    300 ,0
    300 ,1
    please help me

    Strange but this is it
    Processing ...
    with original as (
         select 100 as id ,1 as v1,0 as v2,1 as v3,0 as v4,1 as v5
         from dual
         union all
         select 200 ,1 ,0 ,1 ,0,1
         from dual
         union all
         select 300 ,1 ,0 ,1 ,0,1
         from dual
    select id,v1 as res_row
    from original
    union all
    select id,v2
    from original
    union all
         select id,v3
         from original
    union all
         select id,v4
         from original
    union all
         select id,v5
         from original
                      ID                                   RES_ROW
                                       100                                      1
                                       200                                      1
                                       300                                      1
                                       100                                      0
                                       200                                      0
                                       300                                      0
                                       100                                      1
                                       200                                      1
                                       300                                      1
                                       100                                      0
                                       200                                      0
                                       300                                      0
                                       100                                      1
                                       200                                      1
                                       300                                      1
    15 row(s) retrievedBye Alessandro

  • How to display records from base table as well as some other table?

    Hello expert,
    I have a requirement to develope a form described below:
    One control block and database block.
    DB block  is based on table T1 (USER, Table_name, Column_name, ACCESS);
    In control block, there are three fields,
    User, Table user will enter , and DB block will query based on control block fields(user, table_name).
    In table it is not necessary that all the columns of any table will be given.
    suppose there is a Table X consist of 10 column.
    Initially user give access for all the 10 columns through this form.
    if we query for user , table, all the record will come from table T1.
    now consider the case, when access given to table X number of columns were 10. after that 2 new columns added later.
    now there is no info of added column in table T1. i want if user query DB block, these newly added column must display in DB Block.
    Please help me out.
    Thanks
    Dhirender

    >i want if user query DB block, these newly added column must display in DB Block.
    You need to modify your form and add the two columns as base table items. Forms does not add two base table items by itself.

  • Insert Records in one table that's not in other table

    Really need your help, I have spent the last five hours on the following code, but can't get it working. What I want done is INSERT records in persons where the same records do not exist in table new_person.
    see the below error: rror at Command Line:1 Column:441
    Error report:
    SQL Error: ORA-00936: missing expression
    00936. 00000 - "missing expression"
    INSERT INTO person (last_name, first_name, mi, full_name, id_number, rank, rank_value, temporary, group_number, status, classification, hire_date, unit_code, phone_update, agency, username, agencycourtcode) select last, first_name, mi, full_name, id_number, rank, rank_value, temporary, group_number, status, classification, hire_date, unitcode, phone_update, 'MSP', 'MSP'||id_number, 'MSP' from new_person a where a.status= 'Active' AND where not exists (select last_name, first_name, mi, full_name, id_number, rank, rank_value, group_number, status, classification, hire_date, unit_code, phone_update, agency, username, agencycourtcode from person where a.id_number = person.id_number);

    Please post your code using tags as this is pretty much unreadable.  See instructions here: http://forums.oracle.com/forums/help.jspa
    But it looks to me like your INSERT has 16 columns and your SELECT has 17, so you probably have something misaligned.
    Also, you have AND WHERE NOT EXISTS, change it to AND NOT EXISTS.
    Also, the select list in your NOT EXISTS subquery doesn't need all those columns.  Just do a SELECT 1.  Oracle doesn't care about the columns only whether a row exists.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I want to enter information in one table and have it update other tables automatically

    I am a very unlearned Numbers user.
    Here is my desire/dilemma.  I run a summer camp and have to record information for our camp.  I use the information in a number of forms from check in and check out to records for each cabin, and more.
    I would like to create a master table that has all of the information for each camper that I will call a master list. I then want to create the tables that will contain the information needed for each specific form.  I want the specific forms to be able to update automatically when new information is entered in the master.  The master record will be sorted by the cabin and bed numbers, so I can tie the subtables to those cells, but I need the row to update as well.
    My question is how can I do this in the shortest and simplest way possible?
    I hope this question is clear.
    Thanks!
    Roy

    Hi Roy,
    Well, the simplest is likely to sort the Master table by Cabin number, then use copy/paste to transfer the information to the separate tables for each cabin. But that's not automatic.
    Before jumping in to this, I'd like a better idea of what your Master table will look like, what one of the sub-tables would look like, and which data you want to transfer from the Master to the Subs. A screen shot would be helpful to anyone trying to help you with this, not just to me.
    One consideration is how you will use the sub-tables. An immediate difficulty that comes to mind if you are goiing to mix retrieved data and directly recorded data on the same table is that data collected from the Master table and data recorded directly on one of the sub tables are independent of each other. Consider the list below:
    1 Bob Baines
    2 Chuck Clay
    2 Dexter Davis
    3 Ed Elmore
    1 Frank Fencepost
    1 Greg Gilson
    3 Harvey Hall
    Bob, Chuck and Frank would appear (in that order) on the Cabin 1 list:
    Bob       x √ √ √
    Frank    √ √ √ √
    Greg     √ x x √
    But if Chuck, for some reason, was transferred to cabin 1:
    1 Bob Baines
    1 Chuck Clay
    2 Dexter Davis
    3 Ed Elmore
    1 Frank Fencepost
    1 Greg Gilson
    3 Harvey Hall
    That transfer would affect only the data collected from the Master table. The data entered directly would remain where it was when entered, with disastrous results to Frank's (so far) perfect attendance record.
    Bob        x √ √ √
    Chuck    √ √ √ √
    Frank     √ x x √
    Greg
    Regards,
    Barry

  • How to re-calculate a column value based on another column value in the same ADF Table row

    Hi,
    I'm using Jdeveloper 11.1.2.3.0.
    I have an adf table with 2 columns, columnA and columnB.
    When the value changed in ColumnA,
    1) i need to call a PLSQL and update the ColumnB value that is returned from PLSQL.
    2) Show a warning message if the existing value in ColumnB is different from the one that is returned from PLSQL.
    Can anybody suggest how can i accomplish this?
    Thanks,
    Vinod

    hi user,
    if you have inputtext means have a valuechangelistener
    in that call your pl/sql function supply input value to the appropriate function then grab the result of the function. then bind the column inputtext and compare with it. then raise your warning using FacesMessage classes.
    Sameh Nassar: Create PL/SQL Function And Call It From Your ADF Application

  • " (quotes) is column values when loading data from csv to oracle table

    I am loading a data from csv file to an oracle table.
    After the data is loaded , lets suppose the value in one column is X.
    when i write a query to fetch data like
    select * from table where col='X' then it gives no output.
    On investigating it was found that the value is stored in col as "X".
    This also happens when i copy paste the value from column to some text editor ....
    i want to remove these double quotes , and also want to know why these are coming...
    Any suggestions guys ?
    Thanks
    Using Oracle 10g

    These quotes are part of your data file. Most CSV-parsers remove those quotes.
    If you are using an external table you can remove them by something like this for your access parameters
    ORGANIZATION EXTERNAL
      TYPE ORACLE_LOADER
      ACCESS PARAMETERS
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        OPTIONALLY ENCLOSED BY '"'
    But if you want to remove them from your existing data use this
    update your_table
      set col1 = trim( '"' from col1 )
    Note that in some CSV-files wich use an enclosing character the enclosing character is itself is used as an escape character to use the enclosing character inside a field.
    For example a field might be "Some text with ""this"" enclosed"
    To correct these fields you might use another update
    update your_table
      set col1 = replace( col1, '""', '"' )

  • How i can rename column in table in another name if the table have adata?

     

    1) add new_column with same datatype to table
    2) update table1 set new_col=old_col;
    3) drop column old_col;

  • Comparison of multiple column values with a single column value

    I have two separate tables say Tab1 and Tab2
    I want to select some datas , which is common to both the tables.
    In tab1 , there is a column 'STATE' and it's value is 'A'
    In tab2, there are multiple columns for the state, say STATE_A,STATE_B, STATE_C ETC and a row is present with the following details
    STATE_A = 1, STATE_B =1 ,STATE_C =0,STATE_D=1
    I need to select STATE when STATE_A ='1',
    if my STATE='B', this STATE has to be selected since STATE_B =' 1', similraly
    if my STATE='D', this STATE has to be selected since STATE_D =' 1',
    If my STATE='C', STATE_C should not get selected since it's '0'.
    Is it possible to do this in a single SELECT statement, where I have some other checks also or else how can I achieve it?

    Maybe this will help
    Select * from STATE_MAS ;
    STATE
    A
    B
    D
    F
    H
    Select * from STATE_CHILD
      STATE_A   STATE_B   STATE_C   STATE_D   STATE_E   STATE_F   STATE_G   STATE_H   STATE_I   STATE_J
            1         0         0         1         1         0         0         0         0         0
    CREATE OR REPLACE FUNCTION GET_STATE (P_VAL VARCHAR) RETURN NUMBER IS
    V_SQL VARCHAR2(200);
    V_COL VARCHAR2(35);
    P_RETURN NUMBER ;
    BEGIN
    V_COL := 'STATE_'||P_VAL;
    V_SQL := 'SELECT 1 FROM STATE_CHILD WHERE '||V_COL||' = 1 ';
    EXECUTE IMMEDIATE  V_SQL INTO P_RETURN ;
    RETURN P_RETURN ;
    END;
    SELECT STATE FROM STATE_MAS
    WHERE GET_STATE(STATE) = 1 ;
    STATE
    A
    D

  • Column values split to multiple columns

    Hello Everyone,
    I know there is a way to do this below requirement. But please help me to sort out from this.
    I've values likebelow
    Subject
    Qualifications
    Philosophy 
    PhD
    Philosophy 
    MPhil
    Philosophy
    MSC
    Philosophy
    AdvPGDip
    economics
    BEd
    economics
    PG
     But i need to generate output like this
    Subject     Qualification1   Qualification2  Qualification3  Qualification4 
    Philosophy  phd                  Mphil              Msc                 
    AdvPGDip
    economics   BEd                  PG
    In original table  got more than 3000 qualifications but each subject have maximum 4 qulaifications only there is no order required means like qualification1 will have any either Phd,Mphil,msc, advPGdip from the qualification column for subject 'Philosophy'.
    Kindest regard
    A-ZSQL

    generated that above structure with joining more tha15(almost i got 46 columns) table but when i follow above query for qalifications
    I got output agein like this
    Subject        qual1     qual2          qual3             qual 4
    Philosophy    Phd       null            null               null
    Philosophy    null       AdvDip        null               null
    Philosophy    null       null            Msc                null
    Philosophy    null       null           null                Mphil
    How to merge all these rows into 1 row (46 columns rows all are same except these 4 qulaifications)
    Thanks in Advance
    A-ZSQL

  • Programatically Assigning Column Value Based on Another Column

    I have a problem as follows:
    My database table has the following setup:
    There may be many gift numbers the same, however many different recipient numbers for each gift.
    The receipient number should increment from 1-X based on the gift number, for example, if the gift number is the same then the receipient number should increment for that gift.
    Gift Number
    Recipient Number
    1
    1
    1
    2
    1
    3
    2
    1
    3
    1
    3
    2
    The programmatic code for inserting a new row would be:
    Check if gift number already exsists in database.
    -if it does exsist then find latest and increment current receipient number by one for receipment number
    -if it does not exsit set receipient number at 1
    How do i do this?
    JDEV - 11.1.2.4 (ADF BC)

    Your use case has some flaws which you should think about before trying to implement it.
    1) think about what happens if multiple users try to insert a record at the same time. What can happen? How do you want to handle this situation?
    2) do you really need the number to be gap less? The use case can be implemented easily if you don't have this restriction.
    3) The table should have the technical primary key to avoid pk clashes due to multiple inserts at one time.
    Now, if you have a technical pk as primary key, you can setup a unique key on both of the other columns which prevents that somehow you get duplicates there.
    You let the user insert the gift number and calculate the recipient number as max(recipient number)+1. Then you commit the record. If you don't get an error you are finished, if you get an error you add 1 to the recipient number and try to commit again, until the insert works.
    Timo

  • Updating table with query of 2 other tables?

    Greetings
    I apologize in advance if this seems too easy to do- but I am missing something.
    I have 8000 records in an Access DB (I know- it's going into SQL soon) in which all  the departmental office IDs need to be updated.
    The column in the main table  is named "q_office_ID".
    The user table includes  user_ID &  office_ID.
    The office table also includes office_ID.
    This UPDATE sets all the values to the number 10?:
    <cfquery name="update" datasource="#Request.BaseDSN#">
    SELECT     queue_ID, q_user_ID, user_ID, office_ID
    FROM     main_helpdesk, lookup_user
    WHERE  q_user_ID = user_ID
    </cfquery>
    <cfloop query="update"><cfquery name="updatedata" datasource="#Request.BaseDSN#">
    UPDATE main_helpdesk
    SET q_office_ID = #office_ID#
    </cfquery></cfloop>
    I know there is something obviously wrong with the update- any help would be greatly appreciated.
    Thank You

    Actually, it was:
    <cfquery name="update" datasource="#Request.BaseDSN#">
    SELECT queue_ID, q_user_ID, user_ID, office_ID
    FROM main_helpdesk, lookup_user
    </cfquery>
    <cfloop query="update">
    <cfquery name="updatedata" datasource="#Request.BaseDSN#">
    UPDATE main_helpdesk
    SET q_office_ID = #office_ID#
    WHERE q_user_ID = #user_ID#
    </cfquery></cfloop>
    My mistake.

  • Table layout w.r.t other tables and text while inserting/deleting rows.

    I have 3 tables in a single page. One is left aligned and other two are right aligned. Then there is some text below the tables. 
    Now when I delete some rows from Table-1 the left aligned one, the Table 2 and text shift up filling the space below Table1.
    Now I don't want the text/table to shift up/down when I add/delete rows from Table1 i.e Table1  should expand/contract in the empty space below it.
    Now If I do the same thing for Table3 (Right aligned one) i.e add/delete rows there is no effect on text as shown :
    All 3 tables are same and have exact positioning and other properties.
    Please suggest any solution as I would be populating the table through word automation service (interop).

    Another approach would be to use nested tables, with your 'outer' table having two columns and the inner tables going into different columns. You can hide the outer table's cell borders so its presence is less apparent. If the Outer table has auto row
    height, it will adjust to accommodate whatever row addition/deletion you do to the inner tables. The only proviso is that the inner tables shouldn't have 'around' text wrapping. The two rhs tables can go into the same cell - all they need is a separating paragraph.
    With this layout, the text will always remain below the outer table.
    Cheers
    Paul Edstein
    [MS MVP - Word]

Maybe you are looking for

  • Third party process:Billing relevance 'B' order related and 122

    I am facing the following problem: in Order related Billing according to order qty, the sales order bills what has been received on the third party PO in MM. The following situation occurs: When I order 100, receive 100 and Bill 100: The sales order

  • Need to move all songs to one folder...

    Itunes is what I use to listen to all my music on a Windows XP computer... I got really sloppy and just made multiple folders the use to hold my music for itunes. But now, If I delete a folder the song wont play in itunes, says my friend. I want to k

  • Multiple eventlog errors after mailbox-move to Exchange SP1

    After a mailbox move completes on a Exchange 2013 SP1 server, multiple errors are logged in the eventlog. I opened a ticket with MS Support and they confirm this is a bug in SP1, but the moves itself aren't affected. They state the errors can be igno

  • Problem in using MouseListener

    Here i have board divides into 2 row and 2 columns so it divides into 4 block . There are 3 blocks every one of them contain number and the last one is empty . I want when the mouse enter in empty block the word like " empty" appears but it appears w

  • Oracle Express install and use

    Hi I am having some problems after the installation I can not get the "go to database home page" to load, Ikeep getting an error any help would be appreciated. Thanks - Rich http://127.0.0.1:8080/apex Internet Explorer cannot display the webpage Most