I really need help on this those function DATEDIFF OR DateAdd , because I have no idea on those things.
Declare @EstDate as Date,
@Shipdate as Date,
@Workingday as Int,
I need to do like this:
@EstDate(Date) = @ShipDate(DATE) - @WorkingDay(int) - 2days
Example: @EstDate(date) = ‘6/11/2011’ – 5days – 2days.
How can I do this formula in SQL ? >_< In PHP its easy, but in SQL 2000 up, I have no ideas.
I think this will do it. Basically this adds a negative number of days to @ShipDate. The negative number of days will equal @WorkingDay + 2.
I really don’t know what @WorkingDay is supposed to represent. This example assumes it’s just a number that represents something to you.
It would look something like this, given your example: