I have the following consultation
SELECT
f.SE_Factura,
SE_Consecutivo_Embarque,
f.SE_Orden_De_Compra,
f.SE_Orden_De_Venta,
f.SE_Fecha_OV,
f.SE_Cliente_Despachar_A,
(f.SE_Peso*e.SE_Cantidad_Embarcada)*400 as Peso,
(f.SE_Volumen*e.SE_Cantidad_Embarcada)*400 as Volumen
FROM SE_FactEmbarque f
INNER JOIN SE_Embarques e
ON e.SE_Orden_De_Venta = f.SE_Orden_De_Venta
AND (e.SE_Codigo_Articulo = f.SE_EAN_Articulo OR e.SE_Codigo_Articulo =
f.SE_Codigo_Articulo)
where f.SE_Factura = 'CD-40348'
which brings me the following data
Now what I am trying to do and must do is to know which of the two is greater if the weight or the volume and multiply it by the rate of the following table
Where SE_Cliente_Despachar_A is equal to SE_Cliente