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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Syntax error 2

Status
Not open for further replies.

Trudye

Programmer
Sep 4, 2001
932
US
Hi Guys, I can't seem to get the syntax right. gItemID is an integer; rs2!item is string.

Error I'm getting: Expecting Expression (it highlights the single quote immediately following DealDetailTracking.Item=.

SQL STATEMENT:
strSQL = "SELECT qty, completed, DetailLineID, itemid, item from DealDetailTracking "
strSQL = strSQL & "where ItemId = " & gItemID AND DealDetailTracking.Item= '" & rs2!item & "'"

Thanx so much,
Trudye
 
Second line missing some concatenation operator and quote:

[tt]strSQL = strSQL & "where ItemId = " & gItemID [red]& "[/red] AND DealDetailTracking.Item= '" & rs2!item & "'"[/tt]

Roy-Vidar
 
strSQL = strSQL & "where ItemId = " & gItemID & " AND DealDetailTracking.Item = '" & rs2!item & "'"
 
Thanks Guys it worked like a charm.

Trudye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top