Search Results

Search found 6532 results on 262 pages for 'computed columns'.

Page 16/262 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Add opening and closing balance columns

    - by user1862899
    i have a table like this: StockNumber|InventoryName|Year|Month|Adj|iss|piss|Tsfr|return|rdj|rpo|xefr alb001 clinic1 2010 1 4 5 5 5 6 5 4 10 alb001 Clinic1 2010 2 10 2 2 3 3 4 4 4 alb001 Clinic1 2010 4 11 3 5 77 90 78 9 6 alb001 Clinic1 2010 5 10 2 2 3 3 4 4 4 i want to add a closing balance column which will be sum(return+rdj+rpo+xefr) - sum(adj+iss+piss+tsfr) i also want to add the opening balance column which will be the be the closing balance of the previous month. i will then calculate the current months balance as OpeningBalance + sum(return+rdj+rpo+xefr) - sum(adj+iss+piss+tsfr) = ClosingBalance NB.The Year and Month columns are floats and also want to change them to date format. i am newbie to sql and crystal reports....i want a query to help me achieve the tasks of developing a report that has the opening and closing balance columns,the opening balance being the previous closing balance.....thank you for your help....

    Read the article

  • Using VirtualMode on a DataGridView when the number of rows/columns isn't known

    - by Nathan Baulch
    I need to display an unknown length sequence of dictionaries with unknown keys efficiently in a data grid. This sequence is the result of a potentially slow LINQ query that could contain any number of results. At first I thought that VirtualMode on DataGridView was what I was looking for but it appears that the number of rows and columns must be known upfront. I tried adding a single row and column then adding more as needed from the CellValueNeeded event but this doesn't work. Is this even possible with VirtualMode? Or do I need to estimate how many rows are visible on the screen and manually build up the rows/columns? And if so, how do I ensure that a vertical scrollbar is present and react appropriately when a user uses it?

    Read the article

  • C#: Changing the order of columns when binding DataTable to a GridView

    - by Nir
    How is it possible to change the displayed order of columns from a DataTable? For example, dataTable "dt" contains two columns "a" and "b". I bind it to a GridView like this: gridView.DataSource = dt; gridView.DataBind(); But I'd like the GridView to display "b" first (leftmost). Important point: I'm using this to export to Excel and there's no actual output to screen, using: HtmlTextWriter htw = new HtmlTextWriter(sw); gridView.RenderControl(htw); Thanks!

    Read the article

  • concatenating results from SQL query and NULL columns

    - by Curtis
    I need to concatenate several columns of a table into a single value, then show that value in an asp dropdownlist. The SQL code I'm issuing is as follows: SELECT UserID, CustomerNum, UserName + ' - ' + UserAddress + ',' + UserCity + ' ' + UserState AS UserInfo FROM Users WHERE (CustomerNum = @CustomerNum) ORDER BY UserName I then set 'UserInfo' as the text field in the dropdownlist. This generally works, except occasionally one of the columns in the database is null (for example, UserState). When that happens, the entire concatenation is null, and I get an empty entry in the dropdownlist. Is there something in SQLServer that will allow me to ignore those NULL results, or will I have to code something up in the DataBind event? Thanks

    Read the article

  • Implications of Fulltext Search over many columns

    - by Alex
    Hello, I have a really wide table which includes separate columns for billing address, shipping address, primary address, names, aliases etc. (I can't normalize this table further, and that's not the question here anyways). I'm implementing SQL Server fulltext search, and I'm wondering whether I should limit the search ability to just the primary fields (primary address and names for example), or if I can extend the search ability across all columns without occurring too much of a performance or memory penalty. I've done some basic testing with 10,000 sample rows and it's quite fast but I don't have much experience with fulltext indexing, especially its dictionary internals, so I don't know if the index is going to grow over time, or if there is anything else to consider. Thoughts?

    Read the article

  • DDEX Firebird editing queries duplicates columns in Visual Studio 2008

    - by A Bothe
    Hello everybody! I don't know if some of you also has experienced it but when I edit a query in Visual Studio (it uses DDEX 2.0.5 for accessing the Firebird 2.5 database), it duplicates some of the columns. What's really interesting is the fact that only System.Boolean columns are duplicated: Originally, there was only ,for instance, a 'PRO_DELETED' field... Now I wanted to sort my results by this field - I had to change the select statement in the so-called QueryBuilder by adding "ORDER BY PRO_DELETED" ...After clicking OK it somehow created a new column (!?) called 'PRO_DELETED1' My question is: Why does DDEX add such a new row to the column view and why can't I access the original PRO_DELETED field anymore? Thanks in advance!

    Read the article

  • Maintaining the position of columns in Grails/GORM

    - by firnnauriel
    Is there a way to fix the position of the columns in a domain? I have this domain: class SnbrActVector { int nid String term double weight static mapping = { version false id(generator: 'assigned') } static constraints = { nid(blank:false) term(blank:false) weight(blank:false) } } This is the schema of the table generated: CREATE TABLE `fractor_grailsDEV`.`snbr_act_vector` ( `id` bigint(20) NOT NULL, `weight` double NOT NULL, `term` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `nid` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci It seems that the order of the columns were reversed. Is there a way to make it like this? (order is nid, term, weight) CREATE TABLE `fractor_grailsDEV`.`snbr_act_vector` ( `id` bigint(20) NOT NULL, `nid` int(11) NOT NULL, `term` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `weight` double NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

    Read the article

  • 3 fixed Columns (header and footer) using DIVs, NO Absolute DIVs, IE friendly, ALL columns stretch e

    - by Phillip Schein
    Left to right, Col1 id 560px wide with 10 px padding, middle column, 250px wide with 5px padding and Col3 (siderbar) is 200px wide with 3px padding. Background coloR, no matter text length in any column should stretch vertically equal. No javascript (jQuery workarounds) to make it work. It needs to be pure Semantic Markup with CSS. Each Column should have a nested column of color were content will go. Column 1 should be SEO prominant which means the highest nested column for Google and other Search Engines to crawl. I have used 'The Holy Grail" layout, articles at "A List Apart" and these solution are so convoluted that they push the main columns left and than the nested columns push them with padding back right. This is crazy! I try to adjust these examples, but they're not editable by just adjusting a width in the CSS or the padding, etc. Can you please help me?

    Read the article

  • Using reshape + cast to aggregate over multiple columns

    - by DamonJW
    In R, I have a data frame with columns for Seat (factor), Party (factor) and Votes (numeric). I want to create a summary data frame with columns for Seat, Winning party, and Vote share. For example, from the data frame df <- data.frame(party=rep(c('Lab','C','LD'),times=4), votes=c(1,12,2,11,3,10,4,9,5,8,6,15), seat=rep(c('A','B','C','D'),each=3)) I want to get the output seat winner voteshare 1 A C 0.8000000 2 B Lab 0.4583333 3 C C 0.5000000 4 D LD 0.5172414 I can figure out how to achieve this. But I'm sure there must be a better way, probably a cunning one-liner using Hadley Wickham's reshape package. Any suggestions? For what it's worth, my solution uses a function from my package djwutils_2.10.zip and is invoked as follows. But there are all sorts of special cases it doesn't deal with, so I'd rather rely on someone else's code. aggregateList(df, by=list(seat=seat), FUN=list(winner=function(x) x$party[which.max(x$votes)], voteshare=function(x) max(x$votes)/sum(x$votes)))

    Read the article

  • R- delete rows in multiple columns by unique number

    - by Vincent Moriarty
    Given data like this C1<-c(3,-999.000,4,4,5) C2<-c(3,7,3,4,5) C3<-c(5,4,3,6,-999.000) DF<-data.frame(ID=c("A","B","C","D","E"),C1=C1,C2=C2,C3=C3) How do I go about removing the -999.000 data in all of the columns I know this works per column DF2<-DF[!(DF$C1==-999.000 | DF$C2==-999.000 | DF$C3==-999.000),] But I'd like to avoid referencing each column. I am thinking there is an easy way to reference all of the columns in a particular data frame aka: DF3<-DF[!(DF[,]==-999.000),] or DF3<-DF[!(DF[,(2:4)]==-999.000),] but obviously these do not work And out of curiosity, bonus points if you can me why I need that last comma before the ending square bracket as in: ==-999.000),]

    Read the article

  • dymanic columns in mysql tables?

    - by fayer
    i want to add dynamic columns in a mysql table. but i dont know exactly how. i want to let the user add some columns (fields) in a thread. eg. let him add a integer field and a value (eg. price: 199) or a string field and a value (eg. name: teddybear). the user can add as many field/value-pairs as he wants. i thought i could create a many-to-many table: thread <- thread_field <- field thread: id, title thread_field: field_id, thread_id, value field: id, name is this a good structure? but in this way i have to set a specific column type of thread_field.value. either its an integer or a string. i want to have the possibility to have it dymanic, let the user choose. how can i do this? thanks!

    Read the article

  • [SQL] Getting the sum of several columns from two tables

    - by romaintaz
    I want to get the sum of several columns from 2 different tables (these tables share the same structure). If I only consider one table, I would write this kind of query: SELECT MONTH_REF, SUM(amount1), SUM(amount2) FROM T_FOO WHERE seller = XXX GROUP BY MONTH_REF; However, I would like to also work with the data from the table T_BAR, and then have a select query that return the following columns: MONTH_REF SUM(T_FOO.amount1) + SUM(T_BAR.amount1) SUM(T_FOO.amount2) + SUM(T_BAR.amount2) everything grouped by the value of MONTH_REF. Note that a record for a given MONTH_REF can be found in one table but not in the other table. In this case, I would like to get the sum of T_FOO.amount1 + 0 (or 0 + T_BAR.amount1). How can I write my SQL query to get this information? For information, my database is Oracle 10g.

    Read the article

  • VBA for filtering columns

    - by Ampi Severe
    I have a big database-like sheet, first row contains headers. I would like a subset of rows of this table based on column values. Two issues: 1) VBA-wise I would like to loop through the columns, when the values for all necessary columns all match, copy the entire row into a new sheet. 2) The subset of rows is based on a list. This should be the first column to be looped through. For example I want all rows where the value in column A is equal to one of the values in my list. Is there any possibility to autofilter strings based on a list (column) of strings? EDIT Thanks to @Doug Glancy the autofiltering works now, so I've removed my (horrible) code and issue 1 is solved.

    Read the article

  • Spanning columns in HTML table.

    - by Tony
    I'm trying do to a very simple operation of merging two columns in a table. This seems easy with the colspan, but if I merge different columns without leaving at least one row without any merged columns, the sizing gets completely messed up. Please see the following example at http://www.allthingsdope.com/table.html or take a look at and try the following code: Good: <table width="700px"> <tr> <th width="100px">1: 100px</th> <td width="300px">2: 300px</td> <td width="200px">3: 200px</td> <td width="100px">4: 100px</td> </tr> <tr> <th width="100px">1: 100px</th> <td colspan=2 width="500px" >2 & 3: 500px</td> <td width="100px">4: 100px</td> </tr> <tr> <th width="100px">1: 100px</th> <td width="300px">2: 300px</td> <td colspan=2 width="300px">3 & 4: 300px</td> </tr> </table> Bad: <table width="700px"> <tr> <th width="100px">1: 100px</th> <td colspan=2 width="500px" >2 & 3: 500px</td> <td width="100px">4: 100px</td> </tr> <tr> <th width="100px">1: 100px</th> <td width="300px">2: 300px</td> <td colspan=2 width="300px">3 & 4: 300px</td> </tr> </table> This seems so simple but I can not figure it out!

    Read the article

  • DataGridView avoiding adding new columns

    - by phenevo
    Why, this code create 2 the same columns in grid (Color and Color). How to inputs data color from collection in column which existing before set datasource ?? public Form1() { InitializeComponent(); DataGridViewTextBoxColumn ds = new DataGridViewTextBoxColumn(); ds.Name = "Color"; dataGridView1.Columns.Add(ds); List<Car> cars=new List<Car>(); for (int i = 0; i < 5; i++) { Car car=new Car {Type = "type" + i.ToString(),Color=Color.Silver}; cars.Add(car); } dataGridView1.DataSource = cars; }

    Read the article

  • Update existing columns and rows within csv file using Python

    - by wilbev
    So I've been attempting to use the csv module in Python to add data to existing rows and columns, but only specific columns of each row. So for examples let's say my existing csv file has the following: id, name, city, age 1, Ed,, 34 2, Pat,, 23 So basically the city of each person is missing, so I would like to update each row with that person's city. However, the writerow method only seems replace the existing data within the csv file. Changing the open file to append mode just adds the data to a new row. Is there any way to skip the existing data, and only add the city to each row? Thanks

    Read the article

  • Print Data Frame with Columns Center Aligned in R

    - by Glen
    I would like to print a data frame where the columns are center aligned. Below is what I have I tried, I thought printing the data frame test1 would result in the columns being aligned in the center but this is not the case. Any thoughts on how I can do this? test=data.frame(x=c(1,2,3),y=c(5,6,7)) names(test)=c('Variable 1','Variable 2') test[,1]=as.character(test[,1]) test[,2]=as.character(test[,2]) test1=format(test,justify='centre') print(test,row.names=FALSE,quote=FALSE) Variable 1 Variable 2 1 5 2 6 3 7 print(test1,row.names=FALSE,quote=FALSE) Variable 1 Variable 2 1 5 2 6 3 7

    Read the article

  • Create multiple columns on one sheet from 1 column on another with logic

    - by user450252
    I am new to VBA and I am struggling trying to make this work. I am in need of a macro that will process each cell\column on Sheet1 and put the results on Sheet2. I'm sure this is pretty easy for those who are more advanced with VB code. It contains many columns.. Anytime we encounter a — or an empty cell, we populate the cell with -999 (see the example on Sheet2) on the first column, which contains "0-2". Then we create 2 new columns and populate them with 0 on the first column and 2 on second column (see example on Sheet2). If a value is found on only one side, we then populate both sides with the same number. As each column is being process in Sheet1 and Sheet1: A B Column1 Column2 Title Title2 0–2 0–4 3 — — 5 — — — 10–23 11—29 And the results should look like this on Sheet2 Sheet2 A B C D Column1 Column1 Column2 Column2 Title-A Title-B Title-A Title-B 0 2 0 4 3 3 -999 -999 -999 -999 5 5 -999 -999 -999 -999 —999 -999 -999 -999 10 23 11 29

    Read the article

  • DataGridView - DefaultCellStyle, rows and columns propriority

    - by angelPL
    Hi! In C#, in DataGridView I want to set the BackColor property for the first row and first column. And the cell from first row and first column, should have property from first column, not row - but it does. For example: (table 3 x 3); 'X' - property for first row, 'Y' - property for first column, 'a' - default property should be: Y X X Y a a Y a a but is: X X X Y a a Y a a There is no matter which property I set first: dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.Lavender; dataGridView1.Columns[0].DefaultCellStyle.BackColor = Color.Beige; or: dataGridView1.Columns[0].DefaultCellStyle.BackColor = Color.Beige; dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.Lavender; Sorry for my english...

    Read the article

  • I thought the new AUTO_SAMPLE_SIZE in Oracle Database 11g looked at all the rows in a table so why do I see a very small sample size on some tables?

    - by Maria Colgan
    I recently got asked this question and thought it was worth a quick blog post to explain in a little more detail what is going on with the new AUTO_SAMPLE_SIZE in Oracle Database 11g and what you should expect to see in the dictionary views. Let’s take the SH.CUSTOMERS table as an example.  There are 55,500 rows in the SH.CUSTOMERS tables. If we gather statistics on the SH.CUSTOMERS using the new AUTO_SAMPLE_SIZE but without collecting histogram we can check what sample size was used by looking in the USER_TABLES and USER_TAB_COL_STATISTICS dictionary views. The sample sized shown in the USER_TABLES is 55,500 rows or the entire table as expected. In USER_TAB_COL_STATISTICS most columns show 55,500 rows as the sample size except for four columns (CUST_SRC_ID, CUST_EFF_TO, CUST_MARTIAL_STATUS, CUST_INCOME_LEVEL ). The CUST_SRC_ID and CUST_EFF_TO columns have no sample size listed because there are only NULL values in these columns and the statistics gathering procedure skips NULL values. The CUST_MARTIAL_STATUS (38,072) and the CUST_INCOME_LEVEL (55,459) columns show less than 55,500 rows as their sample size because of the presence of NULL values in these columns. In the SH.CUSTOMERS table 17,428 rows have a NULL as the value for CUST_MARTIAL_STATUS column (17428+38072 = 55500), while 41 rows have a NULL values for the CUST_INCOME_LEVEL column (41+55459 = 55500). So we can confirm that the new AUTO_SAMPLE_SIZE algorithm will use all non-NULL values when gathering basic table and column level statistics. Now we have clear understanding of what sample size to expect lets include histogram creation as part of the statistics gathering. Again we can look in the USER_TABLES and USER_TAB_COL_STATISTICS dictionary views to find the sample size used. The sample size seen in USER_TABLES is 55,500 rows but if we look at the column statistics we see that it is same as in previous case except  for columns  CUST_POSTAL_CODE and  CUST_CITY_ID. You will also notice that these columns now have histograms created on them. The sample size shown for these columns is not the sample size used to gather the basic column statistics. AUTO_SAMPLE_SIZE still uses all the rows in the table - the NULL rows to gather the basic column statistics (55,500 rows in this case). The size shown is the sample size used to create the histogram on the column. When we create a histogram we try to build it on a sample that has approximately 5,500 non-null values for the column.  Typically all of the histograms required for a table are built from the same sample. In our example the histograms created on CUST_POSTAL_CODE and the CUST_CITY_ID were built on a single sample of ~5,500 (5,450 rows) as these columns contained only non-null values. However, if one or more of the columns that requires a histogram has null values then the sample size maybe increased in order to achieve a sample of 5,500 non-null values for those columns. n addition, if the difference between the number of nulls in the columns varies greatly, we may create multiple samples, one for the columns that have a low number of null values and one for the columns with a high number of null values.  This scheme enables us to get close to 5,500 non-null values for each column. +Maria Colgan

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >