Joined: 09 Mar 2012
Online Status: Offline
Posts: 46
Posted: 29 Apr 2020 at 3:08pm
I can not group the report as previously posted since the field I want to group on to do a count contains the "Next" and "Previous" functions.
If I do a formula to return a different record based on those fields it won't let me count or group it.
For example I used the following on the above formula posted earlier with an InStr formula:
if instr({@description repeats},"NO - OK")>0 then 1 else
if instr({@description repeats},"YES - REPEAT!!")>0 then -1 else 0
This returned exactly what I wanted on the report. Problem again is when I go to insert a sum(count) or try to group on this formula I can't since it references the original Next and Previous functions in the original formula.
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 30 Apr 2020 at 4:30am
I am not sure there is. Next and Previous are evaluated after the grouping. So unless you can do something in a sub-report and pass back a result. I do not know if there is another solution. The newer versions of MS-SQL do have previous/next type functions. So it may be possible to do it in a command if your data source is MS-SQL and it is new enough (unfortunately I do not recall what version has the functions)>
Joined: 09 Mar 2012
Online Status: Offline
Posts: 46
Posted: 30 Apr 2020 at 5:28am
Issue "Resolved" - As frustation built I should have done this in the first place. I just exported the resulting printout to an Excel file and sorted it that way.
Thanks keviray for your input. Would still like to know if possible since I sure as you know what figure it out.
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 04 May 2020 at 4:30am
Unfortunately. I do not have much time to devote to working on a solution (I am mostly here just to provide a quick solution if there is one). But if you are using a newer version of MS-SQL (2012 or newer). The functions are called Lead and Lag.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum