Boolean Blues!!
Mike Seargent
Hi Guys,Has anybody had the same problem where CS Designer will display an evaluated boolean result in a field and the correct value of a sub query??
I have 2 boolean statements that I evaluate before executing an sql query Eg
If boolean 1 then
If boolean 2 then
execute sql 1 (get my value)
End If
Else
execute sql 2 (print blank)
End If
CS Designer always displays the following value(s) in the return field
false5.10000
The 5.10000 is the correct value that I want to display but I don't want to display the boolean result and really have no idea where the false value is coming from! :(
For sql 1 to return a value both boolean statements need to be 'true' so i would expect if anything CSD would return true5.10000.
Why return false when it should be true - and why return the boolean result anyway??
Any help appreciated.
Script I'm running is:
textbox105.Value = ""
If GetData("B1_Data.Document.DocCur") <> "DKK" Then
If LD.QueryData("Select MAX(LineVat) FROM INV1 T1, OINV T2 WHERE T1.LineVat > 0 AND T1.DocEntry = T2.DocEntry AND T2.DocNum = " & Data("B1_Data.Document.DocNum")) Then
textbox105.value &= LD.QueryData("Select MAX(T1.rate) FROM ORTT T1, INV1 T2, OINV T3 WHERE T1.Currency = T2.Currency AND T1.Ratedate = T2.DocDate AND T2.DocEntry = T3.DocEntry AND T3.DocNum = " & Data("B1_Data.Document.DocNum"))
End If
Else
textbox105.value = ""
End If
Philipp Knecht
Hi MikeI think you should change the middle part to : ( adding the "> 0")
Dim maxVat As Double = LD.QueryDataNum("Select MAX(LineVat) FROM INV1 T1, OINV T2 WHERE T1.LineVat > 0 AND T1.DocEntry = T2.DocEntry AND T2.DocNum = " & Data("B1_Data.Document.DocNum"))
If maxVat > 0 Then
textbox105.value &= LD.QueryData("Select MAX(T1.rate) FROM ORTT T1, INV1 T2, OINV T3 WHERE T1.Currency = T2.Currency AND T1.Ratedate = T2.DocDate AND T2.DocEntry = T3.DocEntry AND T3.DocNum = " & Data("B1_Data.Document.DocNum"))
End If
hth
0
Please sign in to leave a comment.
Comments
0 comments