please can someone help the value is multiplied by two don't know why the
value must be
24.6 MT
1.2 MT
i grouped the row by part number there is only two part numbers
Related
How do I take the following table:
and make it so the Amount 3 column subtracts from the remaining amount in the row above?
Basically, I know I can do Amount 1 - Amount 2 to get the difference, but if I have multiple values I am trying to subtract from an original value, how can I write a SQL function so the Amount 2 column is added to the cumulative remaining balance in the above Amount 3 column to have a new cumulative remaining amount?
I'm assuming it's some sort of LAG function, but I still need help.
I'm creating a crystal report from several tables.
One table has fields that I want to have sum totals on, but these sum fields are being distorted by number of rows from another table. There are no fields other than DocEntry that I can link with between the two tables.
Here, total bales is repeating 4 times:
If I sum the field total bales, instead of showing 12 the result is 48:
Please assist.
Insert a Group on DocEntry.
Add a Running Total that sums Bales but evaluates only on change of group.
I have been having trouble for a while figuring this out.I have managed to generate fields based on weeks.
Now I want something like this
In Crystal reports How can I achieve this?
i have faced the same case and i found 2 options to solve the same
1- from db level you can add new column to get week number in that year and then get the sum value according to week number.
2- from crystal report, you can set number of weeks in a running field and use mod to get the division remaining (week number mod 2), if it is equal to zero then you can get the sum or reset the sum parameter.
in the formula sum field:
{#DayName} = "Friday" AND {RptEmpMove;1.WeekNum} mod 2 = 0
I’ve got about 1 million records to perform the following calculation, which I was not very successful so far. I appreciate if you could point me to the right direction.
What I’m trying to do is write measures or calculated fields to:
divide the summed field from a value in the grouped raw.
Get the quotient
Get the mod
Calculate price
Display the grand total at the bottom
Example file: https://1drv.ms/x/s!AkN0kHWepnYzgSujfvGKA15fEygW
Appreciate your help
I am having difficulty figuring out how to select a set of rows from my table where the precision of the value of the row is greater than two digits to the right of the decimal point. I have no need for any of the values that are 2 digit precision i only want the ones with greater than 2 digit precision. The end result is that the values with greater than 2 digit precision need to be rounded to constrain the values to only 2 digit precision. The code that inserts the data has been corrected to only insert values with 2 digit precision but i need to fix the ones that aren't.
Hey there, is your goal to find these records, and then update them? below is what I'm imaging you would need to do :
DECLARE #smallmoney as money
set #smallmoney = 1.0097
SELECT #smallmoney as actualValue, ROUND(#smallmoney,2)
WHERE #smallmoney <> ROUND(#smallmoney,2)
As you can see, if the amount of money is already within two decimal points, the where condition will filter that record out.
Hope this works for you!
I hunted around for an answer to the same problem where some script I had written had created a money column to greater than 2 decimal places - like you I needed to go and find the records that were greater than 2 DP - couldn't find the answer on SO, found the below answer elsewhere though.
select ID, MoneyColumn from OurTable
WHERE FLOOR(MoneyColumn*100)!=MoneyColumn*100