Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL statement, need help with brackets please!

Status
Not open for further replies.

zahara666

Technical User
Nov 1, 2001
78
CA
For those that have been helping me out. I really appreciate it.. I have an SQL statement that I need to close - it needs two )) at the end of it - I'm pretty sure..
Could someone follow the below code and possibly help?

Thanks..

strSQL = "UPDATE Int1Table SET Int1Table.Invoiced = Yes WHERE (((Int1Table.Received) Between [Forms]![InvoiceForm]![FromDate] And [Forms]![InvoiceForm]![ToDate]) AND ((Int1Table.ClientCode)="

For Each varItem In ctl.ItemsSelected
strSQL = strSQL & "'" & ctl.ItemData(varItem) & "' Or ([Int1Table].[ClientCode])="
Next varItem

J.
 
Try it with the code below. Access often throws in a bunch of extra parentheses and brackets. Also unless you left something out of context in your post what are you setting the ClientCode equal to at the end of the statement???

strSQL = "UPDATE Int1Table SET Invoiced = Yes WHERE (Received Between [Forms]![InvoiceForm]![FromDate] And [Forms]![InvoiceForm]![ToDate] AND ClientCode="

For Each varItem In ctl.ItemsSelected
strSQL = strSQL & "'" & ctl.ItemData(varItem) & "') Or ClientCode="
Next varItem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top