Gossamer Forum
Home : General : Databases and SQL :

ORDER BY Question

Quote Reply
ORDER BY Question
I have a problem using ORDER BY key word. My company have a SQL database for invoice system. (This database isn't own develop)
Problem is the display result isn't newer invoice. I can do it sorted two field. First field is names "date1" contain add record date. Second field is "invoice_no1" which format is like 01-001/03 (Month-Number of invoice at month/Year). But i can't sorted by date field only because sometime may be add a record at same day. So result is like that:
invoice_no1 date1
12-179/02 12/31/2002
12-178/02 12/31/2002
...............
...............
01-002/03 1/1/2003
01-001/03 1/1/2003

But i want the result is like that:
invoice_no1 date1
01-002/03 1/1/2003
01-001/03 1/1/2003
...............
...............
12-179/02 12/31/2002
12-178/02 12/31/2002

First question : Where can i change the date format to YYYY/MM/DD in SQL datebase? If i change it, my existing database keep on work?
Second question : Can i using ORDER BY for sorting my invoice_no1 field from right to left?
12-179/02
<------
Subject Author Views Date
Thread ORDER BY Question ivanlty 6547 Jan 8, 2003, 8:27 AM
Post Re: [ivanlty] ORDER BY Question
RINGKONG 6147 Jan 8, 2003, 9:50 AM
Post Re: [ivanlty] ORDER BY Question
webmaster33 6158 Jan 8, 2003, 9:51 AM