Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8338717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:40:53+00:00 2026-06-09T04:40:53+00:00

I want to get the sum of a column whose dates are same. Date

  • 0

I want to get the sum of a column whose dates are same.

Date          Charges
3/8/2012       200
3/8/2012       400

4/8/2012       300
4/8/2012       100

<%stat=con.createStatement();
rs=stat.executeQuery("select * from pat.dbo.PHPL"); 
while(rs.next())
{
date=rs.getString("Date");
charges=rs.getString("Charges");%>
<table>

<tr>
<td><%=date%></td>
<td><%=charges%></td>
<%}%>
</tr></table>

Want this result:

Date          Charges
3/8/2012       600
4/8/2012       400

I want this with jsp not in sql query. As I set datatype of charges as String in database. So sum was not be possible in query.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:40:54+00:00Added an answer on June 9, 2026 at 4:40 am

    You don’t give any information about dbms you are using but, by your original query, I assume you are using sqlserver from Microsoft.

    So, you can write:

    select date, sum(cast(charges as float)) from pat.dbo.PHPL group by date.
    See this link:

    http://msdn.microsoft.com/en-us/library/aa226054%28v=sql.80%29

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get N random numbers whose sum is a value. For example,
yes i want to get a child window of another application. Give me Sum
Is it possible to get the sum of a column and all the column
I want to get the sum of applicants that applied to a specific position,
I want to formatting a column of sum value: for example I have 19240
I´m trying to get a sum from the column of the repeated values that
I want get the time used for a case so I can create an
I want get all of the Geom objects that are related to a certain
I want get as much as possible from Redis + Hiredis + libevent. I'm
What I want: get a xml from the AppData to use What I code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.