Results 1 to 12 of 12

Thread: order by

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    order by

    I need to order by vendor name when I call my report from my app...everything works in the formula, except for the "order by"...any help?



    VB Code:
    1. rpt.DataDefinition.RecordSelectionFormula = "{pcms_pcard_transaction_header.end_billing_date} =#" & tranPeriodEnd & "# and {pcms_pcard_transaction_header.card_work_unit}='" & userid_wu & "' order by{pcms_pcard.employee_last_name}"
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    How abpout putting a space between by and {
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075


    same
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Why are using {} instead of [] ?? . Try to replace it with [ ] after ORDER BY .

  5. #5

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    still the same err msg...


    remaining text does not appear to be part of the formula
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    What's the error msg ? and btw , are you sure you should use {} instead of [] ?

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Is this SQL String ??

  8. #8

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    the brackets are working fine in the rest of the formual. I only get the err msg when I add the "order by" clause.

    The err msg is from Crystal...shows my formula and at the end says:

    remaining text does not appear to be part of the formula
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  9. #9

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    not really a sql string...just adding parameters when the reports are ran...is there another way I can order by then?
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try this :

    rpt.DataDefinition.RecordSelectionFormula = "{pcms_pcard_transaction_header.end_billing_date} =#" & tranPeriodEnd & "# and {pcms_pcard_transaction_header.card_work_unit}='" & userid_wu & "=" & "' order by{pcms_pcard.employee_last_name}"

    Changed ...

  11. #11

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    same
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  12. #12
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    Your problem is that you are using the record selection formula to use an 'order by clause'. Remember this is not an sql styring, it is a record selection formula and only accepts record selection criteria.

    If you need to order the records, other than their normal order then either create a view in server explorer and use that, or in your VB code, fill a dataset with your record selection and ordering and then set your datasource on the report obect to use that dataset.

Posting Permissions

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



Click Here to Expand Forum to Full Width