Hi I'm trying to figure out how to calculate certain fields in SQL but I'm running against problems everytime got it working in code on a single form but I want it to in a continuous form.
the form is based on a query Counting ID and Grouped by Type
my code looks something like this
Me.TotalSum = DCount("ID", "tblUnimec", "Type='" & Cbotype & "'")
Me.Sum1 = DCount("[Good]", "tblUnimec", "[Good] = 1 And type='" & Cbotype & "'")
Me.Sum2 = DCount("[Good]", "tblUnimec", "[Good] = 2 And type='" & Cbotype & "'")
Me.Pro1 = (100 / Me.TotalSum) * Me.Sum1 & " %"
Me.Pro2 = (100 / Me.TotalSum) * Me.Sum2 & " %"
Hope some of u guys could help me on transforming it to SQL
the form is based on a query Counting ID and Grouped by Type
my code looks something like this
Me.TotalSum = DCount("ID", "tblUnimec", "Type='" & Cbotype & "'")
Me.Sum1 = DCount("[Good]", "tblUnimec", "[Good] = 1 And type='" & Cbotype & "'")
Me.Sum2 = DCount("[Good]", "tblUnimec", "[Good] = 2 And type='" & Cbotype & "'")
Me.Pro1 = (100 / Me.TotalSum) * Me.Sum1 & " %"
Me.Pro2 = (100 / Me.TotalSum) * Me.Sum2 & " %"
Hope some of u guys could help me on transforming it to SQL