CREATE FUNCTION [dbo].[udtf_DateParameters]
(
@Condition VARCHAR(50)
)
RETURNS @temp TABLE (Startdate DATETIME, Enddate DATETIME)
AS

BEGIN

DECLARE @FromDate DATETIME
DECLARE @ToDate DATETIME

IF (@Condition = 'Today')
BEGIN
SET @FromDate = (SELECT CONVERT(DATETIME, CONVERT(varchar(10), Getdate(), 101) + ' 00:00:00 AM'))
SET @ToDate = (SELECT CONVERT(DATETIME, CONVERT(varchar(10), Getdate(), 101) + ' 11:59:59 PM'))
END

ELSE IF (@Condition = 'Yesterday')
BEGIN
SET @FromDate = (SELECT CONVERT(varchar(10), DATEADD(d, -1, Getdate()), 101) + ' 00:00:00 AM')
SET @ToDate = (SELECT CONVERT(varchar(10), DATEADD(d, -1, Getdate()), 101) + ' 11:59:59 PM')
END

ELSE IF (@Condition = 'Last 7 days')
BEGIN
SET @FromDate = (SELECT CONVERT(varchar(10), DATEADD(d, -7, Getdate()), 101) + ' 00:00:00 AM')
SET @ToDate = (SELECT CONVERT(DATETIME, CONVERT(varchar(10), Getdate(), 101) + ' 11:59:59 PM'))
END

ELSE IF (@Condition = 'Last 30 days')
BEGIN
SET @FromDate = (SELECT CONVERT(varchar(10), DATEADD(d, -30, Getdate()), 101) + ' 00:00:00 AM')
SET @ToDate = (SELECT CONVERT(DATETIME, CONVERT(varchar(10), Getdate(), 101) + ' 11:59:59 PM'))
END

ELSE IF (@Condition = 'This week')
BEGIN
SET @FromDate = (SELECT CONVERT(varchar(10), Getdate()-DATEPART(dw,Getdate())+1 , 101) + ' 00:00:00 AM')
SET @ToDate = (SELECT CONVERT(varchar(10), Getdate(), 101) + ' 11:59:59 PM')
END

ELSE IF (@Condition = 'Last Week')
BEGIN
SET @FromDate = (SELECT CONVERT(varchar(10), Getdate()-DATEPART(dw,Getdate())-6 , 101) + ' 00:00:00 AM')
SET @ToDate = (SELECT CONVERT(varchar(10), Getdate()-DATEPART(dw,Getdate()), 101) + ' 11:59:59 PM')
END

ELSE IF (@Condition = 'Last Month')
BEGIN
SET @FromDate = (SELECT CONVERT(varchar(10), DATEADD(mm, -1, DATEADD(dd, -day(Getdate()) + 1, Getdate())), 101) + ' 00:00:00 AM')
SET @ToDate = (SELECT CONVERT(varchar(10), DATEADD(dd, -day(Getdate()), Getdate()) ,101) + ' 11:59:59 PM')
END

INSERT INTO @temp VALUES (@Fromdate, @todate)

RETURN

END

It can be called like "
select Startdate, EndDate from dbo.udtf_DateParameters('Last Month')"