Pregunta

I'm a noob guys, so don't be too harsh.

New to the forum, read around and couldn't fin d an answer. Maybe someone here knows if this works or not.

Building a computed column in the management studio, We'll call it total. When I enter this equation, it works:

Liquor + Beer + Wine + Food + NonAlc

When I enter this equation it fails and returns null:

Liquor + Beer + Wine + Food + NonAlc + NonAlc - Voucher

All fields are identical data types (money). Can't get it to work with mixed arguments. Anyone have any suggestions for me?

Thanks in advance.

¿Fue útil?

Solución

Do something like this

ISNULL(Liquor, 0) + ISNULL(Beer, 0) + ISNULL(Wine, 0) + ISNULL(Food, 0) 
      + ISNULL(NonAlc, 0) + ISNULL(NonAlc, 0) - ISNULL(Voucher, 0)

Otros consejos

Use this: Concat(Liquor , Beer ,Wine ,food ,NonAlc ,NonAlc - Voucher)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top