|
-
Apr 29th, 2004, 04:46 PM
#1
Thread Starter
Fanatic Member
SQL error (resolved)
Does anyone see anything wrong with this sql statement? I'm getting a syntax error on the last join
VB Code:
strMySQL = ""
strMySQL = strMySQL & "INSERT INTO usys_temp_exception_list "
strMySQL = strMySQL & "( user_id"
strMySQL = strMySQL & ", exception_id )"
strMySQL = strMySQL & "SELECT " & CurrentUserInfo.lngUserID & " AS user_id"
strMySQL = strMySQL & ", [Exception Condition Reports].[Exception ID] AS exception_id"
strMySQL = strMySQL & " FROM ([Exception Condition Reports]"
strMySQL = strMySQL & " LEFT JOIN [Exceptions Copy History] ON [Exception Condition Reports].[Exception ID] = [Exceptions Copy History].[Exception ID])"
strMySQL = strMySQL & " LEFT JOIN [Exceptions Routing History] ON [Exception Condition Reports].[Exception ID] = [Exceptions Routing History].[Exception ID]"
strMySQL = strMySQL & " LEFT JOIN detail_exception_actions ON [Exception Condition Reports].[Exception ID] = detail_exception_actions.[Exception ID]"
Debug.Print strMySQL
Thanks in advance
Last edited by demotivater; Apr 29th, 2004 at 04:55 PM.
-
Apr 29th, 2004, 04:49 PM
#2
So Unbanned
That's not a good method... it's slow.... The less strings that you put together the better.
Try:
strMySQL = "INSERT INTO usys_temp_exception_list " & _
"( user_id" & _
"etc."
-
Apr 29th, 2004, 04:54 PM
#3
Thread Starter
Fanatic Member
Yea, I got it. That's what i ended up doing. I'm fixing someones code and the entire program is written like this, it's really a pain in the rear. Weird that I didn't really change anything though, just combined it all into one line and it worked. Oh well, screw it, it works.
Thanks
-
Apr 29th, 2004, 05:41 PM
#4
So Unbanned
Yea... other's code can be confusing... improper... and just plain illogical.
Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|