Problem in Sorting - VB6 DataReport Using Ms Data Shape
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Problem in Sorting - VB6 DataReport Using Ms Data Shape

  1. #1
    Join Date
    Feb 2011
    Posts
    5

    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

    '********************************************************

  2. #2
    Join Date
    Aug 2011
    Posts
    33

    Re: Problem in Sorting - VB6 DataReport Using Ms Data Shape

    "... INNER JOIN partsactual ON services.servtype =..."

    service.servtype it's a field or a table?

  3. #3
    Join Date
    Feb 2011
    Posts
    5

    Re: Problem in Sorting - VB6 DataReport Using Ms Data Shape

    Hi nexusm,
    'servtype' is the field of the table 'services'..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center