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
<------
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
<------