'yyyymmdd' - need help with file formatting
Posted on 1999-01-25
here is the problem: I need to create a text file in Sybase where one of the values has the format char(8) 'yyyymmdd'. There is no such format in Sybase's convert function. So, I use convert(char(4),datepart(yy,GetDate())) + same for month and + same for day.The problem is when month is 1, I get 1999125 which means 1999 Jan 25, and even if I add a space to make it up to 8 characters it does not resolve the problem, because it is not clear if 1999125 1999 Dec 5 or 1999 Jan 25.
Does anyone know how to select 19990125 meaning 1999 Jan 5th?