Hi, I have an application that automates the Reference Number (or Ticket Number) for every new record encoded in the database in this pattern/hash:
REQ1111-0001
where: 'REQ' is a string (my prefix for request),
'11' - current year (4th & 5th char);
'11' - current month (6th & 7th char);
'-' dash (1 character; 8th place);
'0001' - number that increments every time a new record is added.
I attempted to first write a Select statement (SQL/MS Access) to know the last ticket number in the database for the current year and current month, but I don't know how to include the reserved word 'MAX' in this statement:
Everytime I try to insert MAX in that statement, errors occur. Can anyone please help me? Thanks.
REQ1111-0001
where: 'REQ' is a string (my prefix for request),
'11' - current year (4th & 5th char);
'11' - current month (6th & 7th char);
'-' dash (1 character; 8th place);
'0001' - number that increments every time a new record is added.
I attempted to first write a Select statement (SQL/MS Access) to know the last ticket number in the database for the current year and current month, but I don't know how to include the reserved word 'MAX' in this statement:
Code:
SELECT * FROM PO_tbl WHERE (((PO_tbl.[PO_Num]) Like 'REQ' & Format(Now(),'yy') & Format(Now(),'MM') & '%'))
Comment