thread183-1661264
SQL Server Mg Studio Express
I don't have the date function.
I'm trying to convert in string but I don't know how to write it in the SP.
Please help me with this:
USE [DB]
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[Z_TEST]
@FromRepDate smalldatetime,
@ToRepDate smalldatetime
AS
DECLARE @DateStart VARCHAR(8)
DECLARE @DateEnd VARCHAR(8)
SET @DateStart = CONVERT(VARCHAR(8), @FromRepDate, 3) AS [DD/MM/YY]
SET @DateEnd = CONVERT(VARCHAR(8), @ToRepDate, 3) AS [DD/MM/YY]
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT
…..
FROM
….
WHERE
…
AND (FreightJobs.RepDate >= @DateStart AND FreightJobs.RepDate<@DateEnd)
…
Gives me the error
Incorrect syntax near the keyword 'AS'.
SQL Server Mg Studio Express
I don't have the date function.
I'm trying to convert in string but I don't know how to write it in the SP.
Please help me with this:
USE [DB]
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[Z_TEST]
@FromRepDate smalldatetime,
@ToRepDate smalldatetime
AS
DECLARE @DateStart VARCHAR(8)
DECLARE @DateEnd VARCHAR(8)
SET @DateStart = CONVERT(VARCHAR(8), @FromRepDate, 3) AS [DD/MM/YY]
SET @DateEnd = CONVERT(VARCHAR(8), @ToRepDate, 3) AS [DD/MM/YY]
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT
…..
FROM
….
WHERE
…
AND (FreightJobs.RepDate >= @DateStart AND FreightJobs.RepDate<@DateEnd)
…
Gives me the error
Incorrect syntax near the keyword 'AS'.