cancel
Showing results for 
Search instead for 
Did you mean: 

Excel formula to SQL formula for query

jeroenw
Participant
0 Kudos

Hi,

I have an Excel formula that I want to convert to an SQL formula so I can use it in a query.

The Excel formula is:

=D2*CEILING((B2-C2)/D2;1)

I thought I could use RoundUp, but that funcation is not available in SAP.

The formula in SAP looks like this:

t0.purpackun*RoundUp((T1.[Maxstock]-((t1.onhand-t1.iscommited)+ t1.onorder))/t0.purpackun,1) as 'Order quantity',

View Entire Topic
Johan_H
Active Contributor
0 Kudos

Hi,

As it turns out, MS SQL has a function called CEILING.

SELECT CEILING(1.4/0.6)
/* result: 3 */

Regards,

Johan