Comments posted to this topic are about the item Aging report GP Dynamics
Mr or Mrs. 500
This script appears to make short work of a problem we experience. However, I can not be sure since it calls '[dbo].[uf_AR_EndPrd_Date]())' which I do not have to make use of.
The User Function is nothing more than a date function. It can be commented out and the program will run fine. You could subsititute select cast(getdate() as date) as 'User Date'
/****** Object: UserDefinedFunction [dbo].[uf_AR_EndPrd_Date] Script Date: 10/14/2014 7:27:36 AM ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
--IF OBJECT_ID (N'dbo.ISOweek', N'FN') IS NOT NULL
-- DROP FUNCTION dbo.ISOweek;
ALTER FUNCTION [dbo].[uf_AR_EndPrd_Date] ()
declare @cyr as int
declare @cprd as int
declare @pyr as int
declare @pmth as int
declare @Begdate as date
declare @EndDate as date
set @pmth = (select month(getdate())-1)
set @pyr = (Select year(getdate())-1)
if @pmth = 0
set @pmth = 12
if @pmth >=1 and @pmth <12
set @pyr = (select year(getdate()))
set @EndDate = (select Perdendt
where periodID = @pmth
and year1 = @pyr
and series = 3
and odesctn = 'Receivables Cash Receipts')
The User Function is nothing more than a date function. It can be commented out and the program will run fine.
Thanks for the tip.
Viewing 5 posts - 1 through 4 (of 4 total)