pd_it_guy -> SQL Statement is Too Long (3/31/2008 13:57:57)
Our current SQL, with 3 linked tables (and growing) and lots of data items scrolls way off to the right of the page. It certainly works OK but is unweildy to edit. Breaking it up to multiple lines is apparently something that has to be done exactly right or it simply won't work. I think it needs some odd combination of quotes, ampersands, and underscores but the correct syntax eludes me at the moment. Can anyone enlighten.
rdouglass -> RE: SQL Statement is Too Long (3/31/2008 14:08:13)
quote:
scrolls way off to the right of the page.
You mean on the code page?
How 'bout:
mySQL = "SELECT blah, blah FROM....." mySQL = mySQL & "WHERE blah = ...." mySQL = mySQL & "AND ...."
Is that what you mean?
pd_it_guy -> RE: SQL Statement is Too Long (3/31/2008 14:13:30)
Thanks for the reply. I was thinking, rather than successive definitions of mySqL perhaps something that would break and continue, or otherwise wrap the line. If you just do a hard return it abruptly stops working and goes to error. Should each end be quoted or something?? VB has some routine for breaking up a long string (something like " & _) and starting the next with yet another quote, but it doesnt seem to work here
rdouglass -> RE: SQL Statement is Too Long (3/31/2008 14:21:28)
How about each line ending in:
" _
(double-quote, space, underscore, return)
and the next line beginning with:
& "
(ampersand, space, double-quote)
That will work with VBScript.
EDIT. Actually, I know that works with VB.NET and I *think* it's the same with VBScript.
pd_it_guy -> RE: SQL Statement is Too Long (3/31/2008 14:22:23)
Stand by a sec and we'll try it...
pd_it_guy -> RE: SQL Statement is Too Long (3/31/2008 14:27:33)
Success once again! Thanks so much.... Much easier to look at and work with