on 12-10-2021 6:20 PM
Hi all,
I am trying to figure out a way to apply a rounding method to some items (but not all) in the same price list. I want some to have decimals and others to be integers, all within the same list. Is this possible?
Thanks!
Hi Aaron,
if you have any rule for it, you can use CASE/WHEN
e.g.
SELECT
TOP 100
[ItemCode]
,[Price]
,CASE WHEN LEFT([ItemCode],1) = '2' THEN CAST([Price] as int)
ELSE [Price] END AS [Rounding]
FROM [ITM1]
WHERE
[PriceList] = 10
It means if the first charakter is a 2 then it will be cast as int
regards
Lothar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.