Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW DO YOU WORKOUT THE TOTAL OF 2 FIELDS??

Status
Not open for further replies.

nish

Programmer
Jul 20, 2001
3
IN
I have two dates: HoldayBeginDate and HolidayEndDate.

How do I work out the third field which is Total Number of holiday days.

e.g. 18/06/2001 to 28/06/2001 = 20days holiday,

How do I make it automatically work out 20days or whatever without me inputting the 3rd field only the 1st and 2nd field are inputted.

Thanxs alot Nish
Systems Administrator
 
Use the datediff function in sql*Server
DateDiff(Datepart, date1, date2)

Datediff substracts date1 of date2 and return a integer value.

Example

DateDiff("d", '01-01-2001', '12-01-2001')

Returns 11 days.

Hope this helps

JNC73
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top