BAQ Calculated Field and Vantage Server Error

Brian,

Give this a try...

IF OrderRel.Date01 > 01/01/1999
THEN OrderRel.Date01
ELSE OrderDtl.Date01

Thanks,

NB

--- In vantage@yahoogroups.com, "Brian W. Spolarich "
<bspolarich@...> wrote:
>
> Vantage 8.03.405/SQL.
> I want to add a calculated field to a query on SalesOrder release
info
> that returns OrderRel.Date01 if it is not null, and OrderDtl.Date01
if
> it is:
> FieldName: CalcCustReqBy
> Expression:
> if OrderRel.Date01 = ?
> then OrderDtl.Date01
> else OrderRel.Date01
> Format: (blank)
> Data Type: DateTime
> If I Test the BAQ with this field and expression I get an empty
result
> set. If I remove it, or set the expression to
just "OrderDtl.Date01"
> for example, it returns what I expect.
>
>
>
> The MfgSys803.server.log file shows this error when I run the BAQ:
>
>
>
> [08/12/16@15:35:50.231-0500] P-009408 T-010072 1 AS -- (Procedure:
> 'runSQLQuery bo/DynamicQuery.p' Line:44587) 37000: [Microsoft][SQL
> Native Client][SQL Server]Incorrect syntax near the keyword 'from'.
>
> [08/12/16@15:35:50.231-0500] P-009408 T-010072 1 AS -- (Procedure:
> 'runSQLQuery bo/DynamicQuery.p' Line:44587) 37000: [Microsoft][SQL
> Native Client][SQL Server]Incorrect syntax near 'Customer'.
>
> What's the deal?
>
>
>
> -bws
>
>
>
> --
>
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced
Photonix /
> Picometrix
>
> bspolarich@...
> <mailto:bspolarich@...> ~ 734-864-5618 ~
> www.advancedphotonix.com <http://www.advancedphotonix.com>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Vantage 8.03.405/SQL.



I want to add a calculated field to a query on SalesOrder release info
that returns OrderRel.Date01 if it is not null, and OrderDtl.Date01 if
it is:



FieldName: CalcCustReqBy

Expression:

if OrderRel.Date01 = ?

then OrderDtl.Date01

else OrderRel.Date01

Format: (blank)

Data Type: DateTime



If I Test the BAQ with this field and expression I get an empty result
set. If I remove it, or set the expression to just "OrderDtl.Date01"
for example, it returns what I expect.



The MfgSys803.server.log file shows this error when I run the BAQ:



[08/12/16@15:35:50.231-0500] P-009408 T-010072 1 AS -- (Procedure:
'runSQLQuery bo/DynamicQuery.p' Line:44587) 37000: [Microsoft][SQL
Native Client][SQL Server]Incorrect syntax near the keyword 'from'.

[08/12/16@15:35:50.231-0500] P-009408 T-010072 1 AS -- (Procedure:
'runSQLQuery bo/DynamicQuery.p' Line:44587) 37000: [Microsoft][SQL
Native Client][SQL Server]Incorrect syntax near 'Customer'.

What's the deal?



-bws



--

Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
Picometrix

bspolarich@...
<mailto:bspolarich@...> ~ 734-864-5618 ~
www.advancedphotonix.com <http://www.advancedphotonix.com>





[Non-text portions of this message have been removed]