Create a formula that returns True/False by checking if the first 4 characters of the client field is equal to "SOCO". Then create a Group based on the formula.
Create a formula that returns True/False by checking if the first 4 characters of the client field is equal to "SOCO". Then create a Group based on the formula.
this is in CR? where can i find that in Cr?
To give is always to be NOBLE...
To received is always to be BLESSED....
Each day strive to be NOBLE
Each day strive to be BLESSED
If this post has helped you. Please take time to rate it.
"WHERE (tblClient_Consume_Products.DateOut BETWEEN '" & Format(DTPStart.Value, "mm-dd-yyyy") & "' AND '" & Format(DTPEnd.Value, "mm-dd-yyyy") & "' ) " & _
"GROUP BY tblClient.ClientName, tblClient.ClientBudget"
oConn.Execute sSQL1
Result of the above query:
ClientName Budget Purchase Selling
SOCO-Apopong 960.00 55.50 63.82
SOCO-Calumpang 960.00 56.25 64.68
Doctor's Hospital 3000.00 72.75 83.66
SOCO-Main 5000.00 147.75 169.90
I used the records of temporary table in Crystal Report 9. I used grouped by clientname and here is the result:
ClientName Budget Purchase Selling
Doctor's Hospital 3000.00 72.75 83.66
SOCO-Apopong 960.00 55.50 63.82
SOCO-Calumpang 960.00 56.25 64.68
SOCO-Main 5000.00 147.75 169.90
Total 9920.00 332.25 382.06
i want it to be like this:
SOCO-Apopong 960.00 55.50 63.82
SOCO-Calumpang 960.00 56.25 64.68
SOCO-Main 5000.00 147.75 169.90
Sub-Total 6920.00 259.50 298.40
Doctor's Hospital 3000.00 72.75 83.66
Sub-Total 3000.00 72.75 83.66
Grand Total 9920.00 332.25 382.06
Last edited by Simply Me; Nov 22nd, 2007 at 07:58 PM.
To give is always to be NOBLE...
To received is always to be BLESSED....
Each day strive to be NOBLE
Each day strive to be BLESSED
If this post has helped you. Please take time to rate it.
and at ur Current Table add new column that reference to ParentTable
urCurrentTable = ... + ParentID
... + 1
... + 2
so at the end u can say i want the total Consumption for SOCO, Bank, and so on
PS: perhaps others can explain it better
1st NF - a table should not contain repeating groups.
2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
3rd NF - there should be no dependency between non key fields in same table.
- E. Petroutsos -
My query above came from two tables--tblClient and tblClient_Consume_Products and i created a temptable to save the result of my query. In CR I used temptable for my report.
My tblClient has already ClientID column.
Originally Posted by erickwidya
i think u need some sort of Parent Table that hold 'smaller Company' so u can JOIN from there
Is the parent table different from my tblClient?
Originally Posted by erickwidya
at ur Current Table add new column that reference to ParentTable
are you referring to temptable?
To give is always to be NOBLE...
To received is always to be BLESSED....
Each day strive to be NOBLE
Each day strive to be BLESSED
If this post has helped you. Please take time to rate it.
of course, otherwise i wouldn't say new table, i think urCurrentTable is referring to ClientTable
if u change it..just make sure u SELECT parentID column(or whatever name u use) so that in ur temptable u also have parentID and u can use JOIN from there
like
Code:
SELECT ... from myTempTable INNER JOIN [ParentTable] ...
WHERE [ParentTable].[Name] = 'SOCO' --or Hospital, Bank
and in CR u can use GROUP by [ParentID] and get the result u want
1st NF - a table should not contain repeating groups.
2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
3rd NF - there should be no dependency between non key fields in same table.
- E. Petroutsos -