I have 105 rows with alternating columns of No. sold

I have 105 rows with alternating columns of No. Sold and Amount Sold, for six different dates.  I want the two totals columns on the right to sum every other column for the Total No. Sold and the same but one over for Total Amount Sold.  I know how to do this for a single row, as I have done for the last totals row.  How could I do the formula for all rows without entering it for each one, or if that is not possible, maybe I could copy the formula in some way to make it easier?

rogerfrombellingham wrote:
...  I know how to do this for a single row, as I have done for the last totals row.  How could I do the formula for all rows without entering it for each one, or if that is not possible, maybe I could copy the formula in some way to make it easier?
Yes, Roger, you can easily copy those formulas for all the rest of the 105 rows.
Select the two totals cells, click on the little circle in the lower right corner of the selection and drag it to the bottom.
Jerry

Similar Messages

  • Applying table scroll bar for only table rows with table columns fixed.

    hi oa gurus,
    i had implemented table scroll bars using oarawtextbean , there is no problem in vertical and horizontal scroll bar working its working fine. but the requirement is i need to scroll only the table rows with table columns fixed. so , how to achieve the table scroll for only table datas neglecting table headers.
    the code for vertical and horizontal bars scroll is like this,
    OARawTextBean ors = (OARawTextBean)webBean.findChildRecursive("raw1");
    ors.setText(div id=tabledivid style=height:500px;width:100%; overflow:auto>);
    OARawTextBean ore = (OARawTextBean)webBean.findChildRecursive("raw2");
    ore.setText("</div>");
    where raw1 and raw2 are rawtextbean created above and below of the table . but i dont know hoow to apply this only for table rows neglecting table columns , can anybody give any ideas.
    pelase this is very urgent , can u help me in this regards
    thanks
    Edited by: user630121 on Sep 29, 2008 5:17 AM
    Edited by: user630121 on Sep 29, 2008 5:18 AM

    hi,
    I have a similar task to do... Only to apply scrollbar at the table level.
    I tried using the above mentioned but I am facing Null Pointer Exception..
    Please explain about raw1 and raw2
    Rahul

  • Update rows with a column

    hi
    gurus
    updating a row with a column
    i have first table with 5 columns
    id telephone, telex, mobile,email,santige
    1 9123455 12 987 @ 12452
    i have another second table having a columns like
    id comm , commid
    1 3245 1
    1 23 2
    1 786 3
    1 we@ 4
    1 122 5
    the commid is
    1-telephone 2-telex,3-mobile,4-email,5--santige
    the problem is i want to update the second table with the data of first table
    final data will comes like this
    id comm , commid
    1 9123455 1
    1 12 2
    1 987 3
    1 @ 4
    1 12452 5
    please adjust the data below the columns (for view)

    Something like
    UPDATE table2 t2
       SET comm = (SELECT DECODE(t2.commid, 1, telephone,
                                            2, telex,
                                            3, mobile,
                                            4, email,
                                            5, santige)
                     FROM table1 t1
                    WHERE t1.id = t2.id)should work.
    CREATE TABLE table1 (
      id NUMBER,
      telephone VARCHAR2(100),
      telex     VARCHAR2(100),
      mobile    VARCHAR2(100),
      email     VARCHAR2(100),
      santige   VARCHAR2(100)
    CREATE TABLE table2 (
      id     NUMBER,
      comm   VARCHAR2(100),
      commid NUMBER
    INSERT INTO table1 VALUES( 1, 'telephone', 'telex', 'mobile', 'email', 'santige' );
    BEGIN
      INSERT INTO table2 VALUES( 1, 'x', 1 );
      INSERT INTO table2 VALUES( 1, 'x', 2 );
      INSERT INTO table2 VALUES( 1, 'x', 3 );
      INSERT INTO table2 VALUES( 1, 'x', 4 );
      INSERT INTO table2 VALUES( 1, 'x', 5 );
    END;
    UPDATE table2 t2
       SET comm = (SELECT DECODE(t2.commid, 1, telephone,
                                            2, telex,
                                            3, mobile,
                                            4, email,
                                            5, santige)
                     FROM table1 t1
                    WHERE t1.id = t2.id);
    SQL> SELECT * FROM table2;
            ID COMM                COMMID
             1 telephone                1
             1 telex                    2
             1 mobile                   3
             1 email                    4
             1 santige                  5Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Combining Multiple Rows into single row with multple columns

    Hi Experts,
    I have the following requirement, kindly help me.
    I have data in my table like below.
    ID NAME DEPT
    1 Sam 10
    1 Sam 20
    2 alex     30
    2 alex 40
    2 alex 50
    3 vinod 60
    3 vinod 70
    I want to show the same data into single row with dynamically generating columns for DEPT. I want show like below.
    ID NAME DEPT1 DEPT2 DEPT3
    1 Sam 10 20
    2 alex 30 40 50
    3 vinod 60 70
    It's urgent requirement, kindly help me.
    Thanks in advance.

    Right I've had my drink, so what was this "urgent" question then?
    798616 wrote:
    I have data in my table like below.
    ID NAME DEPT
    1 Sam 10
    1 Sam 20
    2 alex     30
    2 alex 40
    2 alex 50
    3 vinod 60
    3 vinod 70
    I want to show the same data into single row with dynamically generating columns for DEPT. I want show like below.Dynamic numbers of columns eh! Tricky.
    If you understand how SQL statements are executed it's along these lines...
    1. Open Cursor
    2. Parse SQL statement and determine columns
    3. Bind in any input values
    4. Fetch data
    5. Bind out values to columns
    6. Repeat step 3 until no more data
    7. Close cursor
    Now, you're expecting that you can determine the columns (step 2) from the fetched data (step 4 onwards). You can't. The SQL engine needs to know the expected columns before any data is fetched so, it can't base the number of columns on the data itself.
    If you need that requirement, you would need to query the data first and build up a dynamic query based on the data and then execute that dynamically built query to fetch the data and pivot it into those columns, which means that you have queried the data twice. Not good practice and not good (or simple) coding.
    What you're talking of doing is something that should be handled at the presentation/interface layer, not as part of the data fetch.
    Typically these sorts of things are handled most easily in report generation/writer tools such as Oracle Reports, Business Objects etc. where they fetch the data from the database and then process it to format it on the display, pivoting the results as required.
    It's not something that lends itself to be easily achieved in SQL. Yes, SQL can do pivoting of data quite easily, but NOT with a dynamic number of columns.
    If you were to specify that there is a maximum number of columns that you could get (rather than wanting it dynamic), then you can do it simply in SQL with the max-decode method...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select deptno, ename, row_number() over (partition by deptno order by ename) as rn from emp)
      2  --
      3  select deptno
      4        ,max(decode(rn,1,ename)) as ename1
      5        ,max(decode(rn,2,ename)) as ename2
      6        ,max(decode(rn,3,ename)) as ename3
      7        ,max(decode(rn,4,ename)) as ename4
      8        ,max(decode(rn,5,ename)) as ename5
      9        ,max(decode(rn,6,ename)) as ename6
    10        ,max(decode(rn,7,ename)) as ename7
    11        ,max(decode(rn,8,ename)) as ename8
    12        ,max(decode(rn,9,ename)) as ename9
    13        ,max(decode(rn,10,ename)) as ename10
    14  from t
    15  group by deptno
    16* order by deptno
    SQL> /
        DEPTNO ENAME1     ENAME2     ENAME3     ENAME4     ENAME5     ENAME6     ENAME7     ENAME8     ENAME9     ENAME10
            10 CLARK      KING       MILLER
            20 ADAMS      FORD       JONES      SCOTT      SMITH
            30 ALLEN      BLAKE      JAMES      MARTIN     TURNER     WARD
    SQL>

  • Master-detail: one detail row with multiple columns

    Hi All,
    I have a normal master-detail situation in the databse, in the form however all detail rows should be displayed in one single row, using more columns. The number of details are limited, so I can use a predefined number of text-items.
    Any ideas on how to implement this?
    Regards,
    Michiel

    create a function that returns your details. e.g. :
    function get_detail (P_PK, P_rownum) ...
    let's use the example dept and emp. Your master is dept. Your detail is emp. deptno is the PK for the master table.
    you have in your form multi-records of dept and maybe 5 items for employees. The name of the text-items TI_data_1 .. TI_data_5. In the post-query-trigger you code :
    :DEPT.TI_data_1 := get_detail (:DEPT.DEPTNO, 1);
    :DEPT.TI_data_2 := get_detail (:DEPT.DEPTNO, 2);
    if you need more columns create a loop and use the built-in COPY for assigning the detail-values to the text-items.
    the get_detail e.g. is a select-statement:
    SELECT ENAME
    FROM EMP
    WHERE DEPTNO = P_PK
    AND rownum = P_rownum
    ORDER BY EMPNO
    try it
    Gerd

  • Convert multiple rows to one row with multiple columns

    Hi
    i have a table Match_1 with 2 columns 'Source' and 'target'.One source can have multiple targets and that number could be anything
    CREATE TABLE Match_1
    Source CHAR(1),
    Target CHAR(1)
    INSERT INTO Match_1 VALUES ('A', 'B');
    INSERT INTO Match_1 VALUES ('A', 'C');
    INSERT INTO Match_1 VALUES ('A', 'D');
    INSERT INTO Match_1 VALUES ('A', 'E');
    INSERT INTO Match_1 VALUES ('V', 'X');
    INSERT INTO Match_1 VALUES ('V', 'Y');
    INSERT INTO Match_1 VALUES ('V', 'X');
    INSERT INTO Match_1 VALUES ('V', 'W');
    COMMIT;
    i need to get my output in the below format
    Source     target 1     target 2     target 3     target 4          target n
    A     B          C          D               
    V     X          Y          Z          W          
    Could you please provide me the required SQL.
    REgards
    -Learnsequel

    What is your database version (4 digit) ? also my example won't be generate columns for your information:
    it will produce a result like that :
    select source, listagg(target,',') within group (order by target)
      from  match_1
      group by source;
    A     B,C,D,E
    V     W,X,X,Yps: in previos post, I wrote "with" word wrong in sql.

  • Returning two rows with one column containing only one place

    Dear all;
    I have a query that returns two rows similar to this below
    ID      PLACE            PROGRAM
    A       NEWYORK      PROGRAM A
    A       NEWYORK      PROGRAM B
    I would like this instead
    ID      PLACE             PROGRAM
    A       NEWYORK       PROGRAM A
                                   PROGRAM  B
    All help is appreciated. Thank you.Edited by: user13328581 on Mar 22, 2011 11:52 AM

    user13328581 wrote:
    WOW...THanks a lot Solomon, I have never used partitions and row_number in such a manner...can you please explain your logic.Sure:
    row_number() over(partition by id order by place,program)This will take all rows returned by the query andsplit them into buckets (partitions) by id. Inside each bucket it will order rows by place and program and assign them row numbers. So for each ID row number 1 will be row with first (alphabetically) place first programt. And this is the row where we want ID to show up. That is why we wrap the above analytic function in CASE statement which will do exactly that. Now:
    row_number() over(partition by id,place order by program)does pretty much the same just bucket is ID and PLACE combination. So for each such combination we want to show only for the first (alphabetically) programt.
    Now notice in ORDER BY clause I prefix ID and PLACE with table alias. You must do it since otherwise query alias ID and PLACE will take precedence resulting in wrong sort order (remember we nulled all ID and PLACE except for row number 1).
    SY.

  • How to select rows with Empty Column Entry

    I am trying to select all rows with an empty column
    select row1 from table where row2=' ';
    Any suggestions. I tried a space and no space in between the ''.

    An (theoretical) argument could be made that an empty string is not NULL (uknown), however Oracle's SQL and PL/SQL engines make no such distinction for VARCHAR2 and CHAR data types. As stated, you must use NULL as the comparison.
    Michael

  • How to select  rows with duplicate column values

    hi,
    i have a table property_details which has these 2 columns customerno and propertyno a customer can have many properties and property number has to be unique. but somehow these property number has been duplicated at an earlier stage so i have for a customer with many properties the same property number
    how i will select such records whose asset numbers are the same
    for ex
    customer no property no
    a1300 1
    a1300 1
    a1300 1
    a2330 10
    a2330 10
    a2330 10
    kindly suggest me a solution

    this example might be of help.
    SQL> select * from employees;
    YEAR EM NAME       PO
    2001 02 Scott      91
    2001 02 Scott      01
    2001 02 Scott      07
    2001 03 Tom        81
    2001 03 Tom        84
    2001 03 Tom        87
    6 rows selected.
    SQL> select year, empcode, name, position,
      2         row_number() over (partition by year, empcode, name
      3                            order by year, empcode, name, position) as rn
      4    from employees;
    YEAR EM NAME       PO         RN
    2001 02 Scott      01          1
    2001 02 Scott      07          2
    2001 02 Scott      91          3
    2001 03 Tom        81          1
    2001 03 Tom        84          2
    2001 03 Tom        87          3
    6 rows selected.
    SQL> Select year, empcode, name, position
      2    From (Select year, empcode, name, position,
      3                 row_number() over (partition by year, empcode, name
      4                                    order by year, empcode, name, position) as rn
      5            From employees) emp
      6   Where rn = 1;
    YEAR EM NAME       PO
    2001 02 Scott      01
    2001 03 Tom        81
    SQL>

  • How  to identfy  rows  with  same  column value

    Hi
    I have a table student
    id ( pkey)
    name
    class
    marks
    i need to check the existence of duplicate values like
    say the values are :
    id name class marks
    1 alan 6 85
    2 victor 4 97
    3 alan 6 85
    i need to know if there is any matching row in the table --- like in this case id=1 and id=3 have same value for all the columns except for id .
    so the result shud tell me the ids which have duplicate values for name , class , marks and also those ids for which there is no duplicacy
    for id= 1 i see that id= 3 has same values
    and id=2 has no duplicates
    how do i show it ??
    The result i expect is
    name class marks count
    alan 6 85 2
    victor 4 97 1
    Message was edited by:
    SHUBH

    EMP
    id name class marks
    1 alan 6 85
    2 victor 4 97
    3 alan 6 85
    You can use a self join to pull out the data which are almost duplicate without a column values here in this example without id the first and third records are duplicate.
    select e.id,e.name,e.class,e.marks from EMP e,EMP d where e.name=d.ename and e.class=d.class and e.marks=d.marks and e.id<>d.id;

  • How to get multiple records in one row and different column

    Hi All,
    I am using oracle database 11g
    and i have a two tables table_1, table_2
    table_1 having columns
    emp_no
    first_name
    middle_name
    last_name
    email
    and table_2 having columns
    emp_no
    phone_type
    phone_number
    and having entires
    emp_no phone_type phone_number
    1001 MOB 9451421452
    1001 WEMG 235153654
    1001 EMG 652341536
    1002 MOB 9987526312
    1003 WEMG 5332621456
    1004 EMG 59612356
    Now i want the output of values with phone type as MOB or WEMG in a single row with different columns
    emp_no first_name middle_name last_name email mobile officeno
    1001 mark null k [email protected] 9451421452 235153654
    1002 john cena gary [email protected] 9987526312 null
    1003 dany null craig [email protected] null 5332621456
    1004 donald finn sian [email protected] null null
    can i have any inputs to achive this???
    Regards
    $sid

    Frank Kulash wrote:
    sonething like this:Frank, you missed aggregate function (pivot requires one). However main thing is it will cause ORA-01748:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k'last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
    SELECT     *
    FROM     table_1      t1
    JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    PIVOT     (    max(t2.phone_number)
         FOR  t2.phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
            FOR  t2.phone_type  IN  ( 'MOB'   AS mob
    ERROR at line 19:
    ORA-01748: only simple column names allowed hereYou need to:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k' last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
         table_3 as (
                     select  t1.emp_no,first_name,middle_name,last_name,email,
                             phone_type,phone_number
                       FROM     table_1      t1
                       LEFT JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    SELECT     *
    FROM     table_3
    PIVOT     (    max(phone_number)
         FOR  phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
        EMP_NO FIRST_ MIDD LAST_ EMAIL                     MOB       WEMG
          1004 donald finn sian  [email protected]
          1003 dany        craig [email protected] null            5332621456
          1001 mark        k     [email protected]      9451421452  235153654
          1002 john   cena gary  [email protected]    9987526312
    SQL>SY.

  • How to repeat a row when tablix columns print over more than one page

    I have a tablix with 20 Columns.  When this prints it prints over 3 pages (which is
    OK).   The first Column is the Name (in this case it is the
    Project name).  On Page 2 & 3 I want to print the Project name again,
    so that a report user does not need to go back to page one to figure out which
    project the columns are referring two.  In Excel there is an option
    "Rows To Repeat".  I am trying to do the same in SSRS
    2012. 
    I have tried links
    like:
    http://msdn.microsoft.com/en-us/library/dd207045.aspx
    http://remicaron.wordpress.com/2010/01/05/how-to-get-ssrs-to-repeat-the-row-headers-tablix-2008/
    http://www.sqlcircuit.com/2012/03/ssrs-how-to-repeat-column-header-in.html
    These do not work
    for me .... in fact they return an error msg
    Can this be done?
    Tx
    Andrew
    Andrew Payze

    Hi Andrew,
    If I understand correctly, there are 20 columns in the table. When it prints over 3 pages, the report should repeat the first column in all pages.
    To freeze row header in the table, we can refer to the following steps:
    The table should have a group. If the Name is already a row group, we can directly refer to step 2. Or we need add a row group grouped by Name ahead.
    Right-click the table to open the Tablix Properties dialog box, then enable “Repeat header rows on each page” and “Keep header visible while scrolling” options under Row Headers category.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • SSRS Matrix Issue. Expression calculating in row with no data.

    I have a matrix with multiple column groups for different sales channels. With in each group there are several columns and some with expressions for calculations. The rows are based on sales reps. Now not every sales rep sells in every channel, so there
    are some columns in which a rep will have no data. I want them be blank or show a 0. I can do both of those. The issue I am having is in the expressions for reps that have no data, it is still showing a calculation. It seems to populate that cell with whatever
    the first result of an actual calculation is. See below. For rep D and E they have no calls or sales in this particular sales channel; however, the closing ratio is showing 30.23% (which is the closing ratio for rep A). I need this to be blank or 0 or N/A,
    anything other that a wrong %. I have tried numerous iif and isnothing statements, e.g. =iif(Fields!count_of_customers.Value = 0,0,Fields!count_of_customers.Value/iif(Fields!Calls.Value = 0,1,Fields!Calls.Value)) plus other i have found on the internet
    but none of them work. Can someone please help? Sorry it is not a picture of the report. They need to confirm my account before I can attach pictures. But this is the set up of the report.
    Figure A
    Phone Field
    Rep Calls
    Sales Closing Ratio
    Premium Rep
    Calls Sales
    A 1000
    323 32.3%
    $100,250 A
    50 5
    B 200
    10 5% $50,000
    B 0
    0
    C 300
    15 5% $25,000
    C 25
    5
    D 0
    0 32.3%
    $0 D
    300 50
    E 0
    0 32.3%
    $0 E
    100 15
    F 500
    100 20%
    $300,000 F
    0 0

    Hi RobTencents,
    After testing the issue in my environment, I can reproduce it. To fix this issue, please try to use the expression below to instead the original one:
    =iif(sum(Fields!count_of_customers.Value) = 0,0,sum(Fields!count_of_customers.Value)/iif(sum(Fields!Calls.Value) = 0,1,sum(Fields!Calls.Value)))
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Convert a table with one column to panelList with outputText

    Hi,
    I have a table with one column, I would like to change it to use panelList to present it instead. What will be the syntax for panelList?
    <af:table value="#{bindings.ItasUiRuleParamsVO2.collectionModel}"
    var="row"
    rows="#{bindings.ItasUiRuleParamsVO2.rangeSize}"
    emptyText="#{bindings.ItasUiRuleParamsVO2.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.ItasUiRuleParamsVO2.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.ItasUiRuleParamsVO2.collectionModel.selectedRow}"
    selectionListener="#{bindings.ItasUiRuleParamsVO2.collectionModel.makeCurrent}"
    rowSelection="single" id="t2"
    partialTriggers="::t1">
    <af:column sortProperty="RuleName" sortable="true"
    headerText="#{bindings.ItasUiRuleParamsVO2.hints.RuleName.label}"
    id="c11">
    <af:outputText value="#{row.RuleName}"
    id="ot11"/>
    </af:column>
    </af:table>
    I tried this:
    <af:panelList id="pl1">
    <af:forEach items="#{bindings.ItasUiRuleParamsVO2.collectionModel}">
    <af:outputText value="#{item.RuleName}" id="ot14"/>
    </af:forEach>
    </af:panelList>
    but the error say:
    javax.servlet.jsp.JspException: "items" must point to a List or array
         at org.apache.myfaces.trinidadinternal.taglib.ForEachTag.doStartTag(ForEachTag.java:136)
    Any ideas?
    Thanks
    -Mina

    <af:forEach items="#{bindings.ItasUiRuleParamsVO2.collectionModel}" var="row">
    <af:outputText value="#{row.RuleName}" />
    </af:forEach>
    and make sure the table binding is still in place in your pagedef (or binding tab)

  • How can i load data from access database to datagridview with custom columns all days of a month ?

    Hi guys
    I am newbie in vb net and I want your help to solve a problem.
    I have this datagridview with two columns and all days of a month in custom columns.
    [IMG]http://i59.tinypic.com/2qwpj15.png[/IMG]
    I also have one combobox to change Year and a combobox to change Month.
    Here is the code to load data
    Private Sub fill_plan()
    dgMonth.Rows.Clear()
    Try
    Dim i As Integer = 0
    Dim query As String = "SELECT MonID,Unitname,Personel,Udate FROM tblMonth ORDER BY Unitname"
    con.Open()
    cmd = New OleDbCommand(query, con)
    myDR = cmd.ExecuteReader
    If myDR.HasRows Then
    While myDR.Read
    dgMonth.Rows.Add()
    dgMonth.Rows(i).Cells(0).Value = myDR.GetInt32(myDR.GetOrdinal("MonID"))
    dgMonth.Rows(i).Cells(1).Value = myDR.GetString(myDR.GetOrdinal("Unitname"))
    dgMonth.Rows(i).Cells(2).Value = myDR.GetInt32(myDR.GetOrdinal("Personel"))
    i = i + 1
    End While
    End If
    myDR.Close() : con.Close()
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
    End Try
    End Sub
    With
    this code the
    personel column
    loads the first
    day of the month.
    I want to load
    the column the date that is
    in the database.

    Hello,
    This can be done with less code
    Private Sub fill_plan()
    dgMonth.DataSource = Nothing
    Dim dt As New DataTable
    Try
    Dim query As String = "SELECT MonID,Unitname,Personel,Udate FROM tblMonth ORDER BY Unitname"
    con.Open()
    cmd = New OleDbCommand(query, con)
    dt.Load(cmd.ExecuteReader)
    dgMonth.DataSource = dt
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
    End Try
    End Sub
    The above loads all rows, if you want to limit the rows placed in the DataGridView this is best done in the SQL via WHERE conditions and/or with SELECT TOP x.
    Formatting of the data is best done via the property window for the DataGridView on whatever column you want too. Using the above you now need to set the data property for each column and set dgMonth.AutoGenerateColumns = False, in the end we end up with
    less code
    edit is there a reason for returning the primary key? If so then using my method we can hide that field but I see no reason for having it in this case
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

Maybe you are looking for

  • Problem while trying to execute Java class in JSP using  RunTime Class

    Hi, I want to execute a JAVA class through a JSP. For this I am using following code .... JSP (AAA.jsp) CODE ............ try String[] cmd = new String[3]; cmd[0] = "cmd.exe" ; cmd[1] = "/C" ; cmd[2] = "java -DPeBS_CONFIG_HOME=D:/CASLIntegration/PeBS

  • I am converting a PDF to a Word Doc and it is not converting our logo or any handwritten notes to the new document

    I am trying to convert a PDF to a Word Document.  I have only recently started using this item so I am not sure what I am doing wrong.  When the PDF document is converted to the Word doc it is not converting any symbols, logos or handwritten items. 

  • Films or TV programs on the Touch

    I travel quite a bit and I was wondering if there is a LEGAL. Apple approved way of either transferring my own bought DVDs I have to the touch or placing recorded TV programs on it for me to view on the go? I live in the Netherlands which means I can

  • Business document

    When load photos with tx OAOR where are stored the Business documents and how can I configure this? I would like to download all the attached photos to materials to a external directory with a background process. have SAP a FM or class to download a

  • 10.4.11 on one drive works great, Leopard 10.5.8 on slave crashes my G4 Qui

    I have an 867 Mhz G4 max. memory. 10.4.11 on one drive works like a dream.  When Leopard came out I installed it on a new slave drive. Installation went perfect but now trying to start up onto the Leopard almost always crashes at start-up. I did all