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 2008 Forums
 Other SQL Server 2008 Topics
 create constraint for days duration

Author  Topic 

-z-
Starting Member

3 Posts

Posted - 2008-10-08 : 16:03:48
HI ppl... i need to create a contraint for a tour table to only allow insertion of the date to the database when the date different between two date never less than 3 days and never more than 18 days

means that the date different between EndDate and StartDate cant less than 3 days and not more than 18 days

Available details

tourtable
attribute = StartDate, EndDate (datetime datatype)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-08 : 16:28:34
DATEDIFF(DAY, StartDate, EndDate) BETWEEN 3 AND 18


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -