-
August 9th, 2011, 02:00 AM
#1
Problem in Sorting - VB6 DataReport Using Ms Data Shape
Hi Guys,
I would like to group the records in a table and sort the 'servtype' field in DESC order. Based on the code below, the records are grouped as I wanted it to be but why does it not sorted in DESC order? I guess I'm missing something. Please help me out, thanks in advance!
'*******************************************************
strSQL = "SELECT services.joborder, services.description, services.laborcost, services.servtype, services.totalcost, partsactual.amount, partsactual.partstype, partsactual.qty, partsactual.particulars, partsactual.up FROM services INNER JOIN partsactual ON services.servtype = partsactual.servtype WHERE (partsactual.joborder = '" & vjo & "') AND (services.joborder = '" & vjo & "') Order by services.servtype DESC"
dbreport 'open ms data shape connection
Set rs = New ADODB.Recordset
rs.Open " SHAPE(SHAPE {" & strSQL & "} AS cmdGroup Compute cmdGroup, sum(cmdGroup.amount) as subtotal By 'servtype', 'description', 'laborcost', 'totalcost') as rsgroup Compute rsgroup, sum(rsgroup.subtotal) as grandtotal", cn, adOpenStatic, adLockOptimistic, cmdtext
'********************************************************
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|