I am trying to create a holiday system, where users will enter their start date of the holiday, then the number of days.
Is there anyway of getting asp to work out that if holiday starts on 23/March and lasts for 5 days that the end date will be 27, but also I need this to create a entry in the DB that says "booked" on the days in between?
Yes. VBScript has some nifty date handling methods -- DateAdd() being one of them.
In your case, you would use it as follows:
DateAdd("d", 5, "10-Feb-05") // Should return "15-Feb-05"
See here for documentation: http://www.w3schools.com/vbscript/func_dateadd.asp
DateAdd("d", intLengthOfHoliday, dteStartDate)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)