Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 25th, 2006, 03:12 PM
Ruh Ruh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 113 Ruh User rank is Private First Class (20 - 50 Reputation Level)Ruh User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 7 h 53 m 33 sec
Reputation Power: 5
Send a message via MSN to Ruh
Adding data to table1 at specified column

Hi all,

I have got a data like that -

Code:
Man                      Cash     Credit

Adidas                   5000     1500
Samsung                3500     5000
Sony                     6000
Company1                         4500


Now I need to add the numbers in each field, and make a result, like this ->

------------------------------------------

Total: 24500
Cash: 14500
Credit: 10000

Any suggestions? Thanks.

Reply With Quote
  #2  
Old January 25th, 2006, 09:29 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,694 Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 4 h 42 m 17 sec
Reputation Power: 1148
Why do you need to add the data to the table. Don't you just want a summary line at the end? If so, all you need is something to execute this query:
SELECT sum(cash), sum(credit) from table1

and then get the two values and add them together to get the grand total. Then, in your report, make these separate labels (or computed fields) and set them accordingly.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month

Reply With Quote
  #3  
Old January 26th, 2006, 04:43 AM
Ruh Ruh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 113 Ruh User rank is Private First Class (20 - 50 Reputation Level)Ruh User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 7 h 53 m 33 sec
Reputation Power: 5
Send a message via MSN to Ruh
Thanks a lot for your reply.

But still got some difficulties. 1) I don't know where to put that Labels in Rave Report, because it should be at the end, but I dont know how many records I am going to print. How may I put that label - which shows result to the end of the page?

One more question - how may I delete all empty fields in Table? Ex,

Man Cash Credit

Adidas 200 20


Samsung 15

Sony


------------------
It should look like this

Adidas 200 20
Samsung 15
Sony
--------

//editing.. How may I copy all contents of a table1 to the table2 if the field names are the same?

Thanks again.

Last edited by Ruh : January 26th, 2006 at 09:17 AM. Reason: 1+ quest.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Adding data to table1 at specified column


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT