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.
| Author |
Topic |
|
caseycasper
Starting Member
1 Post |
Posted - 2005-05-09 : 13:37:05
|
| Hi - I am creating a view which will have a date, MTD Sales, and Daiy Sales column. The Date and MTD Sales values will be pulled from a table, and Daily Sales will be calculated off of the MTD sales values - today's MTD Sales minus previous day's MTD sales, except for the 1st day of each month, for that the Daily Sales value will be equal to the day's MTD SalesSo it will be like this:Date MTD Sales Daily Sales---- ----------- ------------5/1/2005 100 1005/2/2005 150 505/3/2005 130 -205/4/2005 190 60....6/1/2005 100 1006/2/2005 220 1206/3/2005 150 -70...Note that it is the Daily Sales field that we need to calculate, not the MTD Sales (so it's not like we are calculating a running total of sales here)Any advise would be greatly appreciated!! Thanks! |
|
|
|
|
|