One thing I do when I'm having trouble with a query is I will go and build a mock setup in Access, and play with it in there until I get it tweaked. Then I just use the SQL view to get the syntax that works and port that into my code.
It saves time as opposed to change your code, upload, test. And it doesn't cause any damage to any thing
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.