I'm using an appointment object with Start/EndTime formatted as dd/MM/yyyy because I don't need times but I need the calender view. The user only sees the StartTime and a rule sets EndTime to StartTime and AllDayEvent to True. Now I'd need to be able to add some business days.... Since the "date" actually is a timestamp I can't use the normal BUSINESS_DAY_FORWARD. I have no problem extracting the date part from a timestamp in order to add some business days - but how do I add the timepart to this date again ?
Thanks a lot for any hints
BUSINESS_DAY_[FOR|BACK]WARD
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
If you do not need to set the time part of the attribute as you said, you can simply assign the new date calculated by BUSINESS_DAY_FORWARD to EndTime attribute. The time part will be set to zero.
If you do need to preserve the time part when moving the date forward, you can do it like this:
Appointment.EndTime = Appointment.StartTime + DAY_DIFFERENCE(DATE_PART(Appointment.StartTime), BUSINESS_DAY_FORWARD(DATE_PART(Appointment.StartTime)))*24
If you do need to preserve the time part when moving the date forward, you can do it like this:
Appointment.EndTime = Appointment.StartTime + DAY_DIFFERENCE(DATE_PART(Appointment.StartTime), BUSINESS_DAY_FORWARD(DATE_PART(Appointment.StartTime)))*24
Aware IM Support Team