Viewing 4 posts - 1 through 4 (of 4 total)
Your function could be easier like this:
CREATE FUNCTION [dbo].[ufn_GetYYYYMMSixMonthsAgo_YYYYMM](
@pYYYYMM INT)
RETURNS int
AS
BEGIN
declare @dt...
April 18, 2008 at 1:39 am
Peso (4/17/2008)
SELECTSalesOrderId,
Type,
ISNULL(CONVERT(VARCHAR, Date, 103), 'No Date Specified') AS ExpiryDate
FROMdbo.Values
INNER JOINSalesOrders ON SalesOrders.SalesOrder = dbo.Values.RecordNumber
INNER JOINdbo.DataNameFields ON dbo.DataNameFields.DataField = dbo.Values.DataField
WHEREdbo.Values.DataField = '43'
AND dbo.SalesOrders.Type...
April 17, 2008 at 3:48 am
OR you can use:
----------------
SELECT
CASE
WHEN [DateField] IS NULL then 'No Date Specified'
ELSE convert(varchar, Date, 103)AS ExpiryDate
END AS DD
FROM
[AppsGo].[dbo].[Sales]
April 17, 2008 at 2:17 am
Hi, this is my solution, performance problem can occurs but...
create function uf_Period_Previous:
CREATE FUNCTION [dbo].[uf_Period_Previous](
@Period INT)
RETURNS INT
AS
BEGIN
DECLARE @Year INT
DEClARE @Month TINYINT
DEClARE @PrevPeriod INT
SET @Year = @Period / 100
SET @Month = @Period...
April 17, 2008 at 2:01 am
Viewing 4 posts - 1 through 4 (of 4 total)