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

passing a sting to sql code

Status
Not open for further replies.

missprogrammer

Programmer
Nov 7, 2000
20
US
WsRecordset.Open _
Source:="SELECT DISTINCT Count(dbo_F2KCube_Calls.CallID) " & _
"FROM OUTLETPROGRAM INNER JOIN dbo_F2KCube_Calls " & _
"ON (OUTLETPROGRAM.CallID = dbo_F2KCube_Calls.CallID) " & _
"AND (OUTLETPROGRAM.OutletID = dbo_F2KCube_Calls.OutletID)" & _
"WHERE (((dbo_F2KCube_Calls.Status) = 'e')) Or (((dbo_F2KCube_Calls.Status) = 'f')) " & _
"GROUP BY OUTLETPROGRAM.CustomChar5 HAVING (((OUTLETPROGRAM.CustomChar5)='strRegion' ));"




The code is runing but it is not returning the value which is 189. What am I missing
 

Change the last line of the statement as follows.

HAVING OUTLETPROGRAM.CustomChar5='" & strRegion & "';" Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top