MBoy
asked on
SQL - Conditional return of data
I'd like to remove any value from Data1 that is less than < 99
CREATE PROCEDURE [dbo].[KeyReportsAllEvents ByOperator ]
(
@Operator As varchar(200)
)
AS
BEGIN
SELECT
[EventDateTime] As Date,
[Vehicle],
[Operator],
[EventType] As Event,
[Data1],
[Data2]
FROM
[RemoteData]
WHERE @Operator = [Operator]
ORDER BY [EventDateTime] DESC
END
GO
CREATE PROCEDURE [dbo].[KeyReportsAllEvents
(
@Operator As varchar(200)
)
AS
BEGIN
SELECT
[EventDateTime] As Date,
[Vehicle],
[Operator],
[EventType] As Event,
[Data1],
[Data2]
FROM
[RemoteData]
WHERE @Operator = [Operator]
ORDER BY [EventDateTime] DESC
END
GO
ASKER
I don't want lose the record row. I want to change [Data1] = 1 to [Data1] = ""
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
CREATE PROCEDURE [dbo].[KeyReportsAllEvents
(
@Operator As varchar(200)
)
AS
BEGIN
SELECT
[EventDateTime] As Date,
[Vehicle],
[Operator],
[EventType] As Event,
[Data1],
[Data2]
FROM
[RemoteData]
WHERE @Operator = [Operator] AND [DATA 1]<99
ORDER BY [EventDateTime] DESC
END
GO
Do you want to update the records where Data 1<99?
Thanks,