RE: database help
Hi,
You don't need an additional column in your database table for this -- you can compute it at any time, from what's already there. Use SQL functions datediff(), dateadd() and getdate(). The query might look something like this:
select DateRegistered, LastUpdated, datediff('d', getdate(), dateadd('yyyy', 1, LastUpdated)) as DaysLeftToRenew from MyTable
The above would evaluate to the difference (in days) between the current date and LastUpdated + one year, which sounds like what you want.
This post was edited on 02-17-2006 at 02:59 PM by Adeptus.
|