Thanks, but I think the problem is with how the value is.
xx_id = 2148.0
xxx_id = 2148
xxxx_id = 2148.0 (should I convert the value??)
In order to get the main folder in the database xx_id =xxx_id which is fine, I am able to get records. To get the subfolders name I need to add xxxx_id which get me no records. I don't know what the problem is.
You show xxxx_id = 2148.0 in one post, but in a later post claim that xxxx_id is an integer datatype.
That makes no sense.
Regardless, SQL Server does not care about the datatypes when making equality comparisons:
declare @MyFloat1 Float
declare @MyFloat2 Float
declare @MyInt int
set @MyFloat1 = 2148.0
set @MyFloat2 = 2148
set @MyInt = 2148.0
if (@MyFloat1 = @MyFloat2) and (@MyFloat1 = @MyInt)
print 'Works for me!'
else print 'Crash and burn.'
If it's not practically useful, then it's practically useless.