I have simple SQL Server view that I need to make amends to:

```
CREATE VIEW [dbo].[ApplicantStat]
    AS SELECT ISNULL(CONVERT(VARCHAR(50), NEWID()), '') AS Pkid,
    AVG(ApplicationTime) AS 'AvgApplicationTime',
    AVG(ResponseTime) AS 'AvgResponseTime',
    CAST(ROUND(100.0 * count(case when [IsAccepted] = 1 then 1 end) / count(case when [IsValid] = 1 then 1 end), 0) AS int) AS 'AcceptRate'
    FROM [Application]

```

It works as planned, but I need to add a date range to it. It's not quite as simple as Where > this date and < that date, instead I need to create a range.

Suppose I have a **'CreatedOn'** date in my Application table. I want to be able to include all rows from the last full day (yesterday) and work back 30 days (inclusive).

I'm using SQL Server 2014.