I'm trying to write a stored procedure that returns to my application the next sequential number....in a number of different formats, depending upon what I want for a given table. The last sequential number returned is stored in a table on the server.
I also want to have several variations of ID #'s available to my app such as one using the date in it like 01-081002.
I want the flexibility to return the date in several formats such as mmddyy, ddmmyy, mmddyyy, etc.
I've been trying to use the following statement
convert(varchar,getdate( ),convert(int,date_format)
where date_format = mmddyy
I keep getting the following error: Syntax error during explicit conversion of VARCHAR value 'mmddyy' to a INT field.
Can anyone help please? Can this even be done in Sybase?
I also want to have several variations of ID #'s available to my app such as one using the date in it like 01-081002.
I want the flexibility to return the date in several formats such as mmddyy, ddmmyy, mmddyyy, etc.
I've been trying to use the following statement
convert(varchar,getdate( ),convert(int,date_format)
where date_format = mmddyy
I keep getting the following error: Syntax error during explicit conversion of VARCHAR value 'mmddyy' to a INT field.
Can anyone help please? Can this even be done in Sybase?