What was yesterday?
Create a function that returns yesterday's date.
Este exercicio faz parte do curso
Writing Functions and Stored Procedures in SQL Server
Instruções do exercicio
- Create a function named
GetYesterday()with no input parameters thatRETURNSadatedata type. - Use
GETDATE()andDATEADD()to calculate yesterday's date value.
exercicio interativo prático
Tente este exercicio completando este código de exemplo.
-- Create GetYesterday()
___ ___ GetYesterday()
-- Specify return data type
___ ___
AS
BEGIN
-- Calculate yesterday's date value
___(SELECT ___(day, -1, ___()))
END