Hi,
I am using BOXI with Sql Server db.
The database is a "help desk" type db where tickets are created, closed, and sometimes re-opened and then later closed again. So one ticket could possibly have been closed twice (or more). I am needing to calculate the time it takes from the date/time the ticket was opened to the date/time that the ticket was closed. When I try to get the oldest (first) close date, it always returns the most current one, not the oldest.
I am grouping on the ticket number, then the close date.
I went into the group formula and entered this that I saw in another thread: {table.date} = minimum({table.date},{table.id}) but that didn't do anything. I have a rather large record select formula and I was wondering if I should only have the group or record selections, not both.
As an alternate solution, I also tried adding a command: SELECT "ahd"."call_req"."ref_num", min("ahd"."call_req"."close_date") as mindate
FROM "ahd"."ahd"."call_req"
GROUP BY "ahd"."call_req"."ref_num"
but it took forever to run. I couldn't figure out how to streamline it. (I am not very good at sql). And it would still have the large record selection formula up front.
Any help would be appreciated! Thanks in advance, Rory
I am using BOXI with Sql Server db.
The database is a "help desk" type db where tickets are created, closed, and sometimes re-opened and then later closed again. So one ticket could possibly have been closed twice (or more). I am needing to calculate the time it takes from the date/time the ticket was opened to the date/time that the ticket was closed. When I try to get the oldest (first) close date, it always returns the most current one, not the oldest.
I am grouping on the ticket number, then the close date.
I went into the group formula and entered this that I saw in another thread: {table.date} = minimum({table.date},{table.id}) but that didn't do anything. I have a rather large record select formula and I was wondering if I should only have the group or record selections, not both.
As an alternate solution, I also tried adding a command: SELECT "ahd"."call_req"."ref_num", min("ahd"."call_req"."close_date") as mindate
FROM "ahd"."ahd"."call_req"
GROUP BY "ahd"."call_req"."ref_num"
but it took forever to run. I couldn't figure out how to streamline it. (I am not very good at sql). And it would still have the large record selection formula up front.
Any help would be appreciated! Thanks in advance, Rory