on 11-20-2008 3:20 PM
I am using sort parameters in the stored procedure
the following is my case statment
CASE When @SORT_1 = 'CUSTOMER'
Then ar_ivhdr_tbl.EN_CUST_KEY
When @SORT_1 = 'BILLTO'
Then ar_bill_tbl.ar_bill_name
Else ' ' END SORTKEY
what i would like to do is
have the sort key sort by 2 fields so instead of just the customer sort sorting the customer field
i would like it to sort customer and bill to
this is the syntax i tried but sql doesnt like it
CASE When @SORT_1 = 'CUSTOMER'
Then ar_ivhdr_tbl.EN_CUST_KEY,ar_bill_tbl.ar_bill_key
When @SORT_1 = 'BILLTO'
Then ar_bill_tbl.ar_bill_name, date
Else ' ' END SORTKEY
syntax issues, any ideas?
Hi Sharon,
Your syntax is off. Not sure what database you are using by it should look something like:
CASE @SORT_1
When 'CUSTOMER' Then ar_ivhdr_tbl.EN_CUST_KEY,ar_bill_tbl.ar_bill_key
When 'BILLTO' Then ar_bill_tbl.ar_bill_name, date
Else ' '
END
Good luck,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.