Skip to main content
Answer

For Service Orders that are open I am trying to pull the next scheduled Start Date [ScheduledDateTimeBegin] for the earliest upcoming appointment.

  • October 13, 2025
  • 1 reply
  • 27 views

Forum|alt.badge.img

 For Service Orders that are open I am trying to pull the next scheduled Start Date [ScheduledDateTimeBegin] for the earliest upcoming appointment. 

 

I was able to create a GI that pulls the open services orders for a specific type.  I set the parameters so it does not pull any appointments that are completed only appointments with the status of in process or Not started.  I am stuck because the service order might have 6 appointments listed.  For example it might show several appointments for the same service order SO018443 has 8 open appointments.  I want the GI to only pull the one with the earliest next scheduled start date it would be appointment SO018443-2 which has a scheduled Start date of 10/20/25.   At first I was attempting to use the date in a formula but I hit a wall there. I thought I could use the appointment# but that’s a character type so I can’t use any math formulas and then I thought about using right( String,length) because it would the one with the lowest -XX but when it numbers the appointments it’s not SO018443-01 and SO018443-10.  It’s SO18443-1 and SO018443-10 so I can’t shorten by the same number of characters every time.  Creation date won’t work either because they might all be created on the same date.  Is there a way to change the date into an integer? I know in excel every date has as integer value. 

Any ideas of how to accomplish this?

Best answer by eucciferri35

I figured it out.  I was making it more difficult then it needed to be.  I grouped by service order and just used the MIN aggregate function for the scheduled start date so it only showed me the soonest date.  

1 reply

Forum|alt.badge.img
  • Author
  • Varsity I
  • Answer
  • October 14, 2025

I figured it out.  I was making it more difficult then it needed to be.  I grouped by service order and just used the MIN aggregate function for the scheduled start date so it only showed me the soonest date.