Uhhh, I could have sworn I posted the right one, here it is again...

SELECT payment_methods.ba_type, loan_info.loan_number, loan_info.id AS
loan_id, cust_info.first_name, cust_info.last_name,
transactions.approved_date, payment_types.type FROM loan_info, cust_info,
transactions, payment_methods, payment_types WHERE payment_methods.id =
transactions.payment_method AND payment_types.id = transactions.trans_type
AND cust_info.id = loan_info.cust_id AND transactions.loan_id = loan_info.id
AND transactions.trans_type = 1 AND (transactions.approved_date >=
'2003-07-09 00:00:00' AND transactions.approved_date <= '2003-07-22
23:59:59') AND (loan_info.loan_number LIKE '101%' OR loan_info.loan_number
LIKE '136%' OR loan_info.loan_number LIKE '707%') GROUP BY loan_info.id
ORDER BY payment_methods.ba_type ASC, loan_info.loan_number ASC

Any ideas?

-Dan Joseph

> -----Original Message-----
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 22, 2003 11:39 AM
> To: 'Dan Joseph'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Array Sorting, 2 items...
>
>
> > -----Original Message-----
> > From: Dan Joseph [mailto:[EMAIL PROTECTED]
> > Sent: 22 July 2003 16:29
> >
> > Yeah, I did get it from a mysql_fetch_array().  I have:
> >
> >             ORDER BY
> >                     payment_methods.ba_type ASC,
> >                     loan_info.loan_number ASC
> >
> > However, what it does is first orders it by ba_type, then it
> > goes through
> > and re-orders it be loan_number, not keeping the ba_type
> > order intact.  I
> > would have much rather handled it all with the SQL, but it
> > just doesn't seem
> > to work.  Here's the entire query:
> >
> > SELECT payment_methods.ba_type, loan_info.loan_number, loan_info.id AS
> > loan_id, cust_info.first_name, cust_info.last_name,
> > transactions.approved_date, payment_types.type FROM
> > loan_info, cust_info,
> > transactions, payment_methods, payment_types WHERE
> > payment_methods.id =
> > transactions.payment_method AND payment_types.id =
> > transactions.trans_type
> > AND cust_info.id = loan_info.cust_id AND transactions.loan_id
> > = loan_info.id
> > AND transactions.trans_type = 1 AND (transactions.approved_date >=
> > '2003-07-09 00:00:00' AND transactions.approved_date <= '2003-07-22
> > 23:59:59') AND (loan_info.loan_number LIKE '101%' OR
> > loan_info.loan_number
> > LIKE '136%' OR loan_info.loan_number LIKE '707%') GROUP BY
> > loan_info.id
> > ORDER BY loan_info.loan_number ASC
> >
> > Maybe I'm doing something wrong there?
>
> Well, erm, maybe I've got the wrong glasses on today, or maybe
> you've made a
> cut'n'paste boo-boo, but it sure looks to me like the ORDER BY clause on
> your entire query is not the same as the one you posted above.
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to