On Tue, Nov 15, 2011 at 2:41 AM, Dave Crozier <[email protected]> wrote:
> Stored Procedure and also a generated table holding the period end dates for 
> each period.
>
> Parameters into the SP would simply be the Year and Period.
>
--------------

Dave that is a good idea that needs the fkey column added to all the
tables that needs this type of reporting.

Otherwise

Create procedure spOTPayReport
@StartDate datetime
,@PeriodType char(1)

as
  -- evaluate the @periodtype to set the end date here

declare @endDate as DateTime
-- this is good code for a udf to do this
<http://blog.strictly-software.com/2011/07/tsql-udf-to-return-useful-dates.html>

Now you will have the starting date and the ending date for use within
the regular query you are running.


-- 
Stephen Russell

901.246-0159 cell

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CAJidMYJSu0xPbwH4=_dryd5g9rzzutynu_1h8n02edtmdph...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to