BUSINESS_DAY_[FOR|BACK]WARD

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Hubertus
Posts: 153
Joined: Sat Feb 11, 2006 2:11 pm
Location: Austria
Contact:

BUSINESS_DAY_[FOR|BACK]WARD

Post by Hubertus »

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 ? :roll:

Thanks a lot for any hints
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

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
Aware IM Support Team
Post Reply