It is always difficult to use one language (sql) inside of another language (RB). So it will be very important for you to learn sql apart from RB - or at least the portions of sql you're going to be using. Download a query browser tool and start interacting with your database in the "native" environment. Then bring what you've learned into the RB environment.
There are many good online tutorials for sql. Just don't try to mix in RB until you're familiar with sql. It will save you a ton of frustration.
Ok. Thanks for the tip. I knew SQL was used within several other languages but I didn't realize SQL was stand-alone.