Here's my best answer to answering the original question:
Try this:
/* create a deterministic schema bound function */
CREATE FUNCTION FloorDate(@dt datetime)
RETURNS datetime
WITH SCHEMABINDING
AS
BEGIN
RETURN CONVERT(datetime, FLOOR(CONVERT(float, @dt)))
END
GO
To test, try the following. Please note the use of "PERSISTED" for the computed column and the use of [dbo.] when referring to the function
/*create a test table */
CREATE TABLE [dbo].[TableTestFloorDate](
[Id] [int] IDENTITY(1,1) NOT NULL,
[TestDate] [datetime] NOT NULL,
[TestFloorDate] AS ([dbo].[FloorDate]([TestDate])) PERSISTED,
CONSTRAINT [PK_TableTestFloorDate] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
You should now be able to add an index on the computed column (but see gotcha later)
CREATE INDEX IX_TestFloorDate ON [dbo].[TableTestFloorDate](TestFloorDate)
Insert some random data as many times as you wish but more (1000+) is better if you wish to test index usage/execution plans
INSERT INTO TableTestFloorDate (TestDate) VALUES( convert(datetime, RAND()*50000))
Get the results
SELECT * FROM TableTestFloorDate WHERE TestFloorDate='2013-2-2'
Now here's the GOTCHA...
The index that has been created on the computed column is not used! Instead, even when selecting data on the persisted field TestFloorDate, SQLServer (or at least my version) prefers an index on TestDate.
CREATE INDEX IX_TestFloorDate ON [dbo].[TableTestFloorDate](TestDate)
I'm pretty sure (from memory) that indexes on computed, persisted columns are of benefit from a performance perspective - I guess you'll just have to try/test for your own specific usages
(Hope I've helped!)