Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to Cummulative sum of prevous day

Author  Topic 

suman152
Starting Member

2 Posts

Posted - 2011-07-06 : 04:31:15
Hi Frds,

emp_1

id name salary type last_modified
1 abc 1000 perment 2011-01-31 00:00:00.000
2 hkk 1593 contract 2011-01-31 00:00:00.000
3 gyd 999 permeant 2011-01-31 00:00:00.000
4 aer 1236 permeant 2011-01-31 00:00:00.000
5 wer 1234 permeant 2011-01-31 00:00:00.000
6 bhu 1678 contract 2011-01-31 00:00:00.000
7 qwe 1234 permeant 2011-01-31 00:00:00.000
8 qst 2583 permeant 2011-01-31 00:00:00.000

emp_2

id name salary last_modified
1 abc 1234 2011-01-31 00:00:00.000
2 hkk 2593 2011-01-31 00:00:00.000
3 gyd 1999 2011-01-31 00:00:00.000
4 aer 4236 2011-01-31 00:00:00.000
5 wer 1593 2011-01-31 00:00:00.000
6 bhu 1278 2011-01-31 00:00:00.000
7 qwe 3234 2011-01-31 00:00:00.000
8 qst 2583 2011-01-31 00:00:00.000

adv tkq

Thanks & Regards
Suman SIRAM

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-07-06 : 05:48:50
What exactly are you after, please give examples of your expected outcome.
Go to Top of Page

suman152
Starting Member

2 Posts

Posted - 2011-07-06 : 06:41:38
quote:
Originally posted by RickD

What exactly are you after, please give examples of your expected outcome.



I need current day total in one field and previous in other field
finally the difference between current and previous!!

tks 4rply.

Thanks & Regards
Suman SIRAM
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-07-06 : 07:10:51
but your original data does not show that, it shows an id and name all for the 31-01-2011. Give proper test data and someone will help.
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-07-06 : 08:19:50
Use the front end to calculate the values (Crystal Reports, etc).

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -