How to sum a column in SQL server??
How do I sum a column called 'expenditureamount' in a sql table 'expenditureform', such that I get the total expenditure amount displayed in a text box??
You can sum it with the SQL SUM function, of course, but what that has to do with how your program display that sum, I don't know. IOW, how you display is not anything related to JDBC, and how you SUM it is not anything related to JDBC. The first one is SQL (check on an SQL forum or Google for it) and the second depends on how you want to display it, and there are more appropriate forums than the JDBC one, for that.
Similar Messages
-
How mapping sharepoint list Columns to Sql server data table columns programaticlly
Hi ,
I have one Verification List in share Point ,in that list i have 10 columns.And we have sql server in that sql server we have one data table Verification_Table
in that table we have 25 column, my requirement is all list data move to sql data table[ what ever columns mapping to list--->data table that data store in data table reaming column is Null]
using grammatically not in BCSHello,
You can create SQL connection and use Datareader to read from SQL.Firs create a connection string and put this string in web application web.config file of your sharepoint site.
Now use below code to call your connectionstring in your webpart.
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]);
Here is link to read the data from SQL:
http://www.akadia.com/services/dotnet_data_reader.html
Here is one MSDN link to read SP list data:
http://msdn.microsoft.com/en-us/library/dd490727%28v=office.12%29.aspx
Let me know if you have any doubt
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
How to convert rows to columns in sql server 2008
How to convert rows to columns in sql server 2008 using the GROUP BY function? (only one query allowed)
Lookup the Pivot transformation. From BOL:
The Pivot transformation makes a normalized data set into a less normalized
but more compact version by pivoting the input data on a column value. For
example, a normalized Orders data set that lists customer name, product, and quantity purchased typically has multiple rows for any customer who purchased multiple products, with each row for that customer showing order
details for a different product. By pivoting the data set on the product column, the Pivot transformation can output a data set with a
single row per customer. That single row lists all the purchases by the customer, with the product names shown as column names, and the quantity shown as a value in the product column. Because not every customer purchases every product, many columns may contain
null values.
When a dataset is pivoted, input columns perform different roles in the pivoting process. A column can participate in the following ways:
The column is passed through unchanged to the output. Because many input rows
can result only in one output row, the transformation copies only the first
input value for the column.
The column acts as the key or part of the key that identifies a set of
records.
The column defines the pivot. The values in this column are associated with
columns in the pivoted dataset.
The column contains values that are placed in the columns that the pivot
creates.
Paul -
How to store 999999999.00000000 in sql server through ssis package?
I have a field with 999999999.00000000 value of datatype double ?
How to store it in ms sql server 2005 db through ssis package ?
give me details if I have to use derived columns and what to write over there.
please write in details as I am new to SSIS.
Thanks in Advance.The value is coming from informix db .
Can u please suggest hw to write it in my package :
I have taken a OLE DB Source and wrote the follwing command :
" select CASE WHEN T1.t_maxs IS NULL THEN 0.00 ELSE T1.t_maxs END as max_inv
from ttiitm001010 T1 ".
Please give details, as i am new ... -
How to sum the column in a table seperated by sign.
How to sum the column in a table separate by sign.
For Example:
A B
10 MOHAN
-15 KUMAR
-25 MARCH
50 MAYSELECT SUM(CASE SIGN(A) WHEN 1 THEN A ELSE NULL END) SUM_POSTIIVE,
SUM(CASE SIGN(A) WHEN -1 THEN A ELSE NULL END) SUM_NEGATIIVE
FROM tbl
/SY. -
How to create a database in Sql server management studio
how to create a database in Sql server management studio
One method is to run the SQL statement below from a SSMS query window:
CREATE DATABASE MyDatabase;
You can also right-click on the Databases node in SSMS Object explorer and select New Database.
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
How to connect external database(Ex:SQL Server/Tivoli) from ABAP Webdynpro
Hi,
Any one have idea how to connect external database like SQL Server/Tivoli to access tables from WebDynPro ABAP.
Please point to me some links if you have
Thanks
PraveenHi,
Please check out this link -
FETCH DATA FROM ORACLE DATABASE USING Web Dynpro
Regards,
Lekha. -
How to open sdf files in SQL server 2012?
How to open sdf files in SQL server 2012?
I couldn’t figure out how to open the sdf files in SQL server 2012
Thank you
Best
JamalI don't think it's hard if understood the question properly you can try this I do it most of the time and this might be the solution for you, sometimes minor simple click is a life saver:)
1.
Open SQL Server Management Studio, or if it's running select File -> Connect Object Explorer... and click the
connect drop down arrow
2.
In the Connect to Server dialog you will see Database Enghine, Analaysis Servie on so on and you go head change Server type to
SQL Server Compact Edition
3.
From the Database file drop-down as shown below click the drop down arrow and select <
Browse for more...>
4.
And you will see C:\, D:\, G:\
drive and so on and open, your SDF file where it is located
I hope this has been informative for you and good luck
Please remember to click “Mark as Answer” on the post that has answered your question as it is very relevant to other community members dealing with same problem in seeking the right answer -
Please tell how to store jpeg images in SQL Server using NI Database Connectivity Toolset.
http://www.w3schools.com/sql/sql_datatypes.asp
You setup a field as BLOB and store the binary of the picture there. Depending on the database it can be called differently as you can see in the link, in SQL server there's even a Image datatype.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
How to install and configure the SQL Server
Hi All,
We have to install SQL server in the new server because the old server is crash and need to upgrade. Please advice How to install and configure the SQL Server to run SAP Business One 8.8 successfully and what part we do have to give attention.
Kind Rgds,
SteveHi,
Try this solution:
The step-by-step installation guide can be found in the documentation included in the installation media. (\Documentation\SystemSetup\AdministratorGuide_SQL.pdf).
Below are some important parts that you should pay attention to during the Installation process.
Resolution
Collation setting: It must be set as SQL_Latin1_General_CP1_CI_AS,even the company DB is non-english location. The company DB will be created as corresponding collation settings automatically.
Instance and TCP Port : It is recommended to run SBO on default instance and TCP port 1433. Otherwise,some optional components such as B1i may not work properly.
Native Client: SQL Server Native Client should be installed on every client machine to enable the ODBC connection to DB server.
Rgds, -
How to replicate data from MS SQL Server to Oracle
Hi,
Can someone please help me on how to replicate data from MS SQL Server to Oracle 8i database.Dear,
I'm a student.
I do simple replication on Oracle 8.0.5 successfully. (one master site and one snapshot site). I only use the SQL*Plus and Schema Manager to do.
But when I do advance replication (multimaster replication) I meet many problem. So I don't get the result.
Do you show me the technology to do that ?
Thanks ! -
Desc doesn't show datetime columns from SQl Server
Hi Everyone,
I have working db link to sql server using hsodbc:
Oracle 10.2 on AIX using freetds odbc driver version 0.82.
I can access tables on sql server but oracle sees only varchars and numerics columns in a table.
Is there a way to select datetime columns from sql server using hsodbc?when hsodbc does not show a certain data type it is commonly related to the fact that HSODBC doesn't support the related ODBC data type.
In general you have a data type in your SQL Server which is mapped to an ODBC data type by the ODBC driver. HSODBC then maps the ODBC data type to an Oracle equivalent and when the ODBC data type isn't supported by HSODBC it just drops it from the select list.
So for a root cause analysis an ODBC trace is required to determine the mapping of the FreeTDS ODBC driver.
With this info we can then compare the mapping documented in the HSODBC manual and if the ODBC data type isn't listed as a supported data type you then need to cast the data type on the source side to a different data type (for example varchar/char).
So please post the ODBC trace and I'll have a look.
- Klaus
Edited by: kgronau on Apr 2, 2013 12:50 PM
BTW, here the link to the HSODBC docu:
http://docs.oracle.com/cd/B19306_01/server.102/b14232.pdf
Oracle® Database
Heterogeneous Connectivity Administrator's Guide
10g Release 2 (10.2)
B14232-01
B.1 Mapping ANSI Data Types to Oracle Data Types Through an ODBC
Interface -
How to load oracle data into SQL SERVER 2000?
how to load oracle data into SQL SERVER 2000.
IS THERE ANY UTILITY AVAILABLE?Not a concern for an Oracle forum.
Als no need for SHOUTING.
Conventional solutions are
- dump the data to a csv file and load it in Mickeysoft SQL server
- use Oracle Heterogeneous services
- use Mickeysoft DTS
Whatever you prefer.
Sybrand Bakker
Senior Oracle DBA -
What is Oracle's alternative to IDENTITY Column in SQL Server/ DB2
What is Oracle's alternative to IDENTITY Column(Auto Increment Column) in SQL Server/ DB2 ? Is Sequence and Trigger the only way out for this?
Why is Oracle not creating anything like an Identitiy column in SQL Server?What is Oracle's alternative to IDENTITY Column(Auto
Increment Column) in SQL Server/ DB2 ? Is Sequence
and Trigger the only way out for this?Of course not, you can use in your inserts sequences as well:
insert into blahh values (my_seq.nextval, ...) and use returniong clause to get the value back if necessary
You can use them in insert with subselects
insert into blah
select my_seq.nextval, ...
from ....
>
Why is Oracle not creating anything like an Identitiy
column in SQL Server?Because they are different companies with different people and thoughts and existing mechanism is sufficient i.e. one can even argue that it is even more flexible than identity btw ;)
Gints Plivna
http://www.gplivna.eu -
How to add Two Columns in SQL
For Example
Jan Feb
215 NULL
How to add these two values in SQLAnything + NULL is NULL.
Check this:
SQL> SELECT 1 + NULL from dual;
1+NULL
SQL> You have to do this:
SQL> with t as (SELECT 235 JAN, NULL FEB FROM dual)
2 SELECT NVL(JAN,0) + NVL(FEB,0) FROM t;
NVL(JAN,0)+NVL(FEB,0)
235
SQL>
Maybe you are looking for
-
THE Bridge CC Extensions, so where is this folder to be found on a Windows 7 64?
Maybe I'm the ******* but each time lately it is something else, something new with CC, things are taken out put in another place, things are completely taken out, later added again by special downloads and you have to go and search for the right fil
-
To Select the data from two table one is transp table and onther is cluster
Hi All, I want to select the data from two tables Here i am giving with an example. Fileds: kunnr belnr from bseg. table bseg fields: adrnr from kna1 table: kna1. Know i want to put these into one internal table based on kunnr and belnr. Thanks
-
Help me in creating a Trigger for Insert and Update Options
Hi Please help me in creating a Trigger . My requirement is that after insert or update on a Table , i want to fire an event . I have started this way ,but doesn't know how to fully implement this . say i have a dept table CREATE TRIGGER DepartmentTr
-
Unable to Install iTunes 64 bit on Lenovo X1 with Windows 8.1
I get the error message in the screenshot attached when I try to install iTunes on my Lenovo (W 8.1). I havs done all the uninstalls (iTunes and all Apple and Bonjour programs and folders) and attempted reinstalls, and ever time I get this error mes
-
Performance problems to generate PDF files using CR
Hi, I develop an application that read TXT files and uses this information to generate PDF files, but I'm having problems with performance to generate this PDF, each files are taking at least 1 minute to create the file. I realized that some TMP and