In newer versions (5.5 and higher) you can simply use the query below to get the hotfix number from the database:
SELECT KeyValue, KeyName FROM CMS_SettingsKey WHERE KeyName = 'CMSHotfixVersion'
Otherwise you will have to simply determine it by the table below:
Hotfixes (build #) Hotfix version Build number
5.5 R2
5.5.31 R2 4216
5.5.30 R2 4206
5.5.29 R2 4202
5.5.28 R2 4191
5.5.27 R2 4188
5.5.26 R2 4181
5.5.25 R2 4175
5.5.24 R2 4164
5.5.23 R2 4160
5.5.22 R2 4150
5.5.21 R2 4147
5.5.20 R2 4136
5.5.19 R2 4129
5.5.18 R2 4125
5.5.17 R2 4115
5.5.16 R2 4108
5.5.15 R2 4104
5.5.14 R2 4097
5.5.13 R2 4090
5.5.12 R2 4083
5.5.11 R2 4073
5.5.10 R2 4070
5.5.9 R2 4059
5.5.8 R2 4051
5.5.7 R2 4045
5.5.6 R2 4041
5.5.5 R2 4031
5.5.4 R2 4027
5.5.3 R2 4020
5.5.2 R2 4014
5.5.1 R2 4006
5.5 R2 final / upgrade 3996
5.5
5.5.30 3999
5.5.29 3992
5.5.28 3981
5.5.27 3978
5.5.26 3971
5.5.25 3964
5.5.24 3957
5.5.23 3950
5.5.22 3943
5.5.21 3936
5.5.20 3926
5.5.19 3922
5.5.18 3912
5.5.17 3905
5.5.16 3901
5.5.15 3894
5.5.14 3887
5.5.13 3880
5.5.12 3873
5.5.11 3866
5.5.10 3859
5.5.9 3849
5.5.8 3842
5.5.7 3834
5.5.6 3828
5.5.5 3821
5.5.4 3817
5.5.3 3810
5.5.2 3803
5.5.1 3793
5.5.0 final / upgrade 3789
5.5.0 beta 3751
5.0
5.0.19 3784
5.0.18 3778
5.0.17 3771
5.0.16 3765
5.0.15 3758
5.0.14 3742
5.0.13 3733
5.0.12 3733
5.0.11 3722
5.0.10 3715
5.0.9 3708
5.0.8 3702
5.0.7 3693
5.0.6 3688
5.0.5 3681
5.0.4 3677
upgrade includes 5.0.3 3671
5.0.3 3670
5.0.2 3659
5.0.1 3656
5.0.0 final 3644
5.0.0 beta 3630
4.1
4.1.21 3667
4.1.20 3639
4.1.19 3639
4.1.18 3638
4.1.17 3631
4.1.16 3625
4.1.15 3617
4.1.14 3612
4.1.13 3603
4.1.12 3597
4.1.11 3590
4.1.10 3582
4.1.9 3576
4.1.8 3571
4.1.7 3561
4.1.6 3554
4.1.5 3552
4.1.4 3541
4.1.3 3537
4.1.2 3525
4.1.1 3523
4.1.0 3518
4.1.0 pre final 3513
4.0
4.0.15 3511
4.0.14 3505
4.0.13 3492
4.0.12 3492
4.0.11 3485
4.0.10 3481
4.0.9 3470
4.0.8 3464
4.0.7 3455
4.0.6 3436
4.0.5 3436
4.0.4 3432
4.0.3 3420
4.0.2 3397
4.0.1 3387
4.0.0 3328
-bp-