If not working in the console, "print db._lastsql" will output the sql string to the terminal session where you started web2py, assuming you started it without the gui.
Otherwise I think the gui has a little field to display outputs. On Nov 20, 3:42 pm, villas <villa...@gmail.com> wrote: > Hi Adrian > Good that you are making progress, even though it doesn't look like the > SQL would be equivalent to me. > However, just in case you didn't already know this tip, I have so often > found it useful to see what SQL statement is being generated by prefixing > '_' in front of select, eg > db(query)._select() > > This prints the SQL to the console. However, you can of course also > easily put this into a variable and display the string in any view too. > Regards, D