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!

What am I doing wrong?

Status
Not open for further replies.

missprogrammer

Programmer
Nov 7, 2000
20
US
This query is running but it is not retuning a value.
Is there something wrong with my "having" clause
It returns a value when I just have the Round(intRound) alone, but when I include the Region(strRegion) it does not return any value. What am I doing wrong?


Dim intRound As Integer
Dim strRegion As String


WsRecordset.Open _
Source:="SELECT Count(dbo_F2KCube_Calls.CallID) " & _
"FROM dbo_OutletProgram INNER JOIN dbo_F2KCube_Calls " & _
"ON dbo_OutletProgram.OutletID = dbo_F2KCube_Calls.OutletID " & _
"WHERE (((dbo_F2KCube_Calls.Status) = 'e' Or (dbo_F2KCube_Calls.Status) = 'f') AND ((dbo_OutletProgram.ProgramID)=12))" & _
"GROUP BY dbo_OutletProgram.CustomChar5, dbo_F2KCube_Calls.CallCost " & _
"HAVING dbo_F2KCube_Calls.CallCost = " & intRound & " And dbo_OutletProgram.CustomChar5 = '&strRegion&';"
 
since it is a string it needs to be in quotes ''

And dbo_OutletProgram.CustomChar5 = '" & strRegion & "';"

I also dont see where you are assigning a value to strRegion

so it interperts

And dbo_OutletProgram.CustomChar5 = ""

good luck
 
BRAInDead

values are assigned


strRegion = "Special Account"
intRound = 82


After I made the changes you suggested it's running but ONCE AGAIN no value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top