Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Default Value or Binding

Author  Topic 

jesus4u
Posting Yak Master

204 Posts

Posted - 2008-07-25 : 13:17:07
This is to be used as a default date value whenever a new record is inserted.

How do I take the value from the ListingDuration column (integer type), and add it to the getdate() function? The code below fails....

((CONVERT([varchar](8),getdate() + dbo.ell_Listings.ListingDuration,(112))))

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-25 : 13:50:10
may be this

CONVERT(datetime,CONVERT(varchar(11),getdate(),101) + ' ' + CAST(dbo.ell_Listings.ListingDuration AS varchar(6))
Go to Top of Page
   

- Advertisement -