Re: datatable.compute



In article <#5gMpEP6HHA.5096@xxxxxxxxxxxxxxxxxxxx>,
checht@xxxxxxxxxxxxxxxxx says...
Hello

I am getting a Syntax error in the compute method of a datatable. I want to
SUM the qty field based on a

filter expression and the expression contains 3 fields. Non of the MSDN
documentation nor any other

references tell me I can not do this.



dim str as string =""

str = "item_num =" & "'" & gitem_num & "' + " & "lot_num =" & "'" & gLot_num
& "' + " & "lot_ext =" & "'" & gLot_ext & "'"

TotalPickQty = Convert.ToInt32(dtreceivepdai.Compute("SUM(qty)", str))



{System.Data.SyntaxErrorException}

System.Data.SyntaxErrorException: {"Syntax error: Missing operand after
'5106030' operator."}

Are you sure your "str" (row filter) is correct? Try creating a
DataView with that RowFilter and see if you get any errors:

Dim dv as DataView = New DataView(dtreceivepdai)
dv.RowFilter = str

--
Patrick Steele (patrick@xxxxxxxx)
http://weblogs.asp.net/psteele
.



Relevant Pages

  • Re: Getting the output of compiler and filtering it
    ... into a new splitted buffer and filter the results a little. ... 2.for: Error: Syntax error, found ',' when expecting one ...
    (comp.editors)
  • Re: Problem passing a string to a function
    ... I am passing a tcpdump filter to a function which compiles the filter ... which of course resulted in pcap_compile raising a syntax error. ...
    (comp.lang.c)
  • Re: Searching (i.e., 3,000,000) in a number field using Filter-By-Form
    ... > enter 3,000,000 I get a syntax error. ... > consistently correctly enter data without the help of commas. ... I'm not surprised you're getting the error with Filter By Form, ... format to one of those text boxes, the value of the text box will be the ...
    (microsoft.public.access.forms)
  • Problem passing a string to a function
    ... I am passing a tcpdump filter to a function which compiles the filter ... which of course resulted in pcap_compile raising a syntax error. ...
    (comp.lang.c)
  • pop-up form to filter report
    ... Hi - Have downloaded the sample database "RptSmp97.mdb". ... Syntax error in query ... I'm now getting the same message no matter which filter ... vendor name combobox shows my alpha vendor ID, ...
    (microsoft.public.access.reports)

Quantcast