i need to compare external data with query statment

if mysource.data <= query.data then
dosommething

the data tipe is integer value the query rezult value is integer