Joined: 13 Sep 2007
Location: United States
Online Status: Offline
Posts: 16
Posted: 04 Nov 2008 at 9:45am
In details I am displaying the field {EventStrings.EvStrName}
On the same row in details I have a formula named "AM Routes"
if (Right({EventStrings.EvStrName},1)="B") then {EventStrings.EvStrName} else ""
When {EventStrings.EvStrName} displays a result that ends with an "A" such as 103A to the left of this I need to display the result from {EventStrings.EvStrName} that has the same first three numbers but ends with a "B" such as 103B. There are also additional results in {EventStrings.EvStrName} that will have neither an A or B such as 101 that needs to be displayed.
Joined: 13 Sep 2007
Location: United States
Online Status: Offline
Posts: 16
Posted: 05 Nov 2008 at 11:37am
Thanks, this works but only if records are sorted by the original field of {EventStrings.EvStrName}. I however, have to sort by a different field {Events.schTime} which is a time field. So the results of {EventStrings.EvStrName} do not display in numeric order and the "B" result will not follow the "A" unit when sorted by time.
Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Posted: 06 Nov 2008 at 6:28am
Hi
Build the sql as below
T -Parent Table
TC-Child Table
SELECT T.EVENTTIME, TC.EVENTTIME, T.EVENTSTR, TC.EVENTSTR FROM TABLE_EVT T LEFT JOIN TABLE_EVT tc ON substring(T.EVENTSTR,1,3) = substring(TC.eventstr,1,3) and right(tc.eventstr,1) like '%B' WHERE right(t.eventstr,1) NOT LIKE '%B'
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