Hi Javier,
I'm not sure exactly what you mean, but there are a couple of ways to query SQL data sources. The fields provided in the queryFields group generated by InfoPath can take values that will filter the results returned, or you can use code to edit the raw SQL statement that is sent.
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge