Viewing 10 posts - 1 through 11 (of 11 total)
i have written t-sql
but how can check entry date is this month or previous month
January 16, 2009 at 12:06 pm
create FUNCTION [dbo].[svf_checkdate]
(@pDate datetime
--parameters
--None
)
RETURNS datetime
AS
BEGIN
-- Return variable
DECLARE @_Asofdate as datetime
--Main Query
select @_Asofdate = c.currentdate from vew_Calendar c where c.CurrentDate= @pDate
...
January 16, 2009 at 12:04 pm
suppose i have enter asofdate= 1/16/2009
it should be same asofdate =1/16/2009
because this month isn't end
but if i have enter asofdate = 1/16/2008
it should be asofdate=1/31/2008
January 16, 2009 at 11:38 am
Timclosestatus is column name come from table
January 8, 2009 at 12:04 pm
i need to write function
first check asofdate is current month or prior month
If as of date is prior month and timclose status = c then month end date
else...
January 7, 2009 at 12:26 pm
i need change as of date to default prior month end date
January 7, 2009 at 11:58 am
can i set
set @_AsOfDate = @pAsOfDate
set @_AsOfDate = dbo.svf_GetPriorMonthEndDate_asofdate()
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Description:APL Audit report dataset
-- =============================================
ALTER PROCEDURE [dbo].[rpt_APL_Audit_monthenddate]
-- Parameters
@pAsOfDate datetime,
@pPortAccID int = null
AS
BEGIN
...
January 7, 2009 at 11:27 am
i have done
set @_AsOfDate = dbo.svf_GetPriorMonthEndDate_asofdate()
it not giving me error
but i am not getting any data
i am calling function dbo.svf_GetPriorMonthEndDate_asofdate()
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Description:Get Prior Month...
January 7, 2009 at 11:19 am
i have done that still giving same error
January 7, 2009 at 8:38 am
Viewing 10 posts - 1 through 11 (of 11 total)