cancel
Showing results for 
Search instead for 
Did you mean: 

Carton query

Former Member
0 Kudos

Experts,

Because my Customer will pack several different items into a Carton for delivery, I created a Row UDF (RDR1.U_Carton) to calculate the carton fraction that will be used. This works in the lines.

Now I want to have a Header UDF (ORDR.U_CartonCount) populate with the sum of all the Carton fractions (RDR1.U_Carton) in the lines. And round to higest number, so no fractions is showing on this field.

Can anyone help me on how this Formatted Search will look?

Thanks,

Marli

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try this

select ceiling(sum($[rdr1.U_carton]))

Former Member
0 Kudos

Kamba,

Thanks, I tried this and got the message 'Internal error'

Marli

jitin_chawla
Advisor
Advisor
0 Kudos

Hi,

Check this :

select ROUND(sum($[rdr1.U_carton]),0).

This will round the value to nearest integer.

Kind Regards,

Jitin

SAP Business One Forum Team

Former Member
0 Kudos

Jitin,

Thanks, I tried this and got the error "data type nvarchar invalid for sum operator".

I tried the ORDR.U_CartonCount field as Rate and Numeric, and the RDR1.U_Carton as Rate and Numeric. I also tried adding a Convert() function, but this gave me an error - probably because I did something wrong.

I need the RDR1.U_Carton field to have fractions, and therefore choose Rate.

The ORDR.U_CartonCount field can be anything, as I need whole numbers there.

Thanks for your help.

Marli

Answers (0)