Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a calculated field
Message
From
19/10/2010 09:30:23
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01486104
Message ID:
01486107
Views:
32
>You can have a computed field in your table (and add an index on this field).
>
>Field's definition will be
>
>dateadd(day, NumberOfDays, AddDate)
>
>Then, using this new field, you can write queries such as
>
>declare @Today date -- SQL Server 2008
>
>set @Today = cast(getdate() as date)
>
>select * from myTable where FutureDate < @Today
Thanks, this is good. But, I need to avoid creating additional field or computed field in the table.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform