|
Hi, I'm not very good with using date functions at an advanced level. However, a client of mine has reuested that i create a report(SSIS 2008), that connects to the HEAT database(Change Management System). I need to set up a date parameter where the date entered will collect all the data from two days before, so i would use =dateadd(dd, -2, @reportdate) @ReportDate being my parameter. Now i need to write a query that will sum the closing balance and the open calls during that period as well as the opening balance. The closing balance and the opening balance shoudl correspond. Please advise. Regards, Pinkett
(comments are locked)
|
|
I would get the stored procedure you use to return the data for the report to do the work, so get the user to select the date parameter and manipulate as you've described, please see my example below using AdventureWorks2008. The one thing you will need to be careful of is which type of field you have used whether it's Date or Datetime, as if it's datetime you may need to consider the timings aswell. also need to consider the data type and whether the time part is significant.
Mar 27 '12 at 08:39 AM
Fatherjack ♦♦
Thanks a mil Annette. Just have another question, my query seems to be incorrect because i need to present the report every two days. Now my closing balance from the previous generated Dates, must be the same for the next opening balance. How so i get around that? Thanks
Mar 28 '12 at 10:33 AM
Pinkett
(comments are locked)
|
|
ALTER PROCEDURE [dbo].[usp_RptProc1]( @EndDate Datetime) SELECT CallLog.CallID, CallLog.CustType, CallLog.CallType, CallLog.CallStatus, CallLog.Environment, and to sum up all my open calls i have another stored procedure: ALTER PROCEDURE [dbo].[usp_RptProc2](@EndDate Datetime) What i'm trying to achieve is to get two days worth of data at a time. what am i doing wrong? Today's closing balance must be tomorrow's opening balance
(comments are locked)
|

