Stanley,
You've raised several points which I will try to answer in due course. But let me just pick up on your latest post, where you question the use of [tt]ALTER TABLE dbo.MyTableName ADD date2 AS (DATEADD(day, 3, Date1))[/tt] in conjunction with a need to filter the result set.
The point about that ALTER TABLE is that it is not physically adding a column to the table. Rather, it is creating a computed column, which means that the value is determined on the fly whenever it is needed. So, if at some later time, you did something like [tt]SELECT Date2 FROM MyTable[/tt] or [tt]SELECT * FROM MyTable WHERE Date2 = xxx[/tt], SQL Server would determine the value of Date2 (by adding three days to Date1) at that point.
In fact, you can achieve exactly the same effect by specifying the calculation within the query:
[tt]SELECT DATEADD(day, 3, Date1) AS Date2 FROM MyTable[/tt]
or
[tt]SELECT * FROM MyTable WHERE DATEADD(day, 3, Date1)= xxx[/tt]
but that would have the disadvantage that the details of the calculation would be scattered around your code and therefore difficult to alter, for example if you later needed to change the number of days being added. By using a computed column, you localise that information to your ALTER TABLE statement.
I hope this makes sense.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads