ironhide1975
Programmer
Question for ya, how do I modify this to if I pass a 1 in the PreviewCode variable it makes it
Posted = ‘1’
But if PreviewCode = 0 then is shows
Posted = ‘1 or 0’
USE [DatabaseName]
GO
/****** Object: StoredProcedure [dbo].[sp_GetPages] Script Date: 09/10/2007 13:52:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_GetPages](
@GrabStart varchar(1000) = NULL,
@GrabEnd varchar(1000) = NULL,
@Position varchar(1000) = NULL,
@PageID int = NULL,
@PreviewCode varchar(1000) = NULL
)
AS
Select * From vwPageDesc
WHERE (DateOn -1) < @GrabStart AND (DateOff +1) > @GrabEnd AND Position = @Position AND fkPageInfo = @PageID AND Active = 1 AND Posted = @PreviewCode ORDER by ContentOrder, DateOn Desc, DateOff Desc
Posted = ‘1’
But if PreviewCode = 0 then is shows
Posted = ‘1 or 0’
USE [DatabaseName]
GO
/****** Object: StoredProcedure [dbo].[sp_GetPages] Script Date: 09/10/2007 13:52:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_GetPages](
@GrabStart varchar(1000) = NULL,
@GrabEnd varchar(1000) = NULL,
@Position varchar(1000) = NULL,
@PageID int = NULL,
@PreviewCode varchar(1000) = NULL
)
AS
Select * From vwPageDesc
WHERE (DateOn -1) < @GrabStart AND (DateOff +1) > @GrabEnd AND Position = @Position AND fkPageInfo = @PageID AND Active = 1 AND Posted = @PreviewCode ORDER by ContentOrder, DateOn Desc, DateOff Desc