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
 General SQL Server Forums
 New to SQL Server Programming
 SQL CDate -need help urgent

Author  Topic 

theKid27
Starting Member

21 Posts

Posted - 2013-02-18 : 20:53:57
Hi all,

I'm new to sql can anyone help to explain the below query?

SQL Query :
((CDate(DateAdd("d",[Transit],[Actual Ship Date]))-CDate([Request Date]))>-8)

Whereby the value are as below:
[Transit] = 5
[Actual Ship Date]= 2/6/2013
[Request Date] = 2/22/2013

Thanks


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-18 : 23:41:01
its adding 5 days to [Actual Ship Date] and comparing it with [Request Date] by taking the difference between them. this is then checked against condition >-8 to see if resultant value (ie [Actual Ship Date] + 5 days) is lagging behind [Request Date] by 8 days or more

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

theKid27
Starting Member

21 Posts

Posted - 2013-02-24 : 22:32:54
Thanks visakh16

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-24 : 23:19:37
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -