AnsweredAssumed Answered

ExecSQL struggle

Question asked by Stu412 on Apr 2, 2015
Latest reply on Apr 2, 2015 by philmodjunk

Title

ExecSQL struggle

Post

Hi there

I'm struggling with an ExecSQL query at the moment which is frustrating as all my other queries in other areas are working fine.

I have some data I want to summarise and sum up by customer, and by year.  An example of the data on the table is:

CusID | Group | Value

1010 | 65 | 1000

1010 | 65 | 2000

1010 | 66 | 1400

1010 | 66 | 600

My query is this:

ExecuteSQL ("
 
Select Sum(Value) from ThisTable where 

Group=? and
CusID=? 


";

"";"";

65;
CusID_PK_CusTable

 
)

All I'm getting is question marks at the moment which suggests some sort of error but I cannot find it.  

I would expect a result of 3000, and for 66, a result of 2000 for this particular customer.

The table I have this SQL on is joined to the customer table by the customerID, nothing else.

Any help appreciated.

Thanks

Outcomes