In my SSRS report, there is a matrix showing following data... Every single of data in the matrix is dynamic.
Departure Arravial Bus name Tour
01:51 02:01 07 ABY 04
02:02 02:12 07 AB 978
02:21 02:31 07 ABY 04
02:32 02:42 07 AB 978
03:01 03:11 07 ABY 04
03:02 03:12 07 AB 978
03:31 03:41 07 ABY 04
03:42 03:52 07 AB 978
04:01 04:11 07 ABY 04
What I want to do is count the first row bus name and put it next to it. Can this be achievable with expressions? or how can I come up with such query in SQL? How can I solve this puzzle?
Departure Arravial Bus name Tour
01:51 02:01 07 ABY 04 1
02:02 02:12 07 AB 978
02:21 02:31 07 ABY 04 2
02:32 02:42 07 AB 978
03:01 03:11 07 ABY 04 3
03:02 03:12 07 AB 978
03:31 03:41 07 ABY 04 4
03:42 03:52 07 AB 978
04:01 04:11 07 ABY 04 5
This is my query by the way,
SELECT HCPD.DepartureTime, HCPD.ArrivalTime, V.BusName
FROM HAT_CALISMA_PLANI HCP WITH(NOLOCK)
INNER JOIN HAT_CALISMA_PLANI_DETAY HCPD WITH(NOLOCK) ON HCPD.HatCalismaPlaniKey = HCP.HatCalismaPlaniKey
INNER JOIN VALIDATOR V WITH(NOLOCK) ON V.ValidatorKey = HCPD.ValidatorKey
WHERE HCPD.DepartureTime = @Time AND HCP.HatKey = @HatKey
ORDER BY HCPD.DepartureTime
Edit: Bus names are dynamic.