sybase - SQL: Next Month of Integer Date and return an Integer -
this question has answer here:
- t-sql datetime conversion 7 answers
i have column startmonth integer, example 199812
i need have next month of , return integer 199901
. how handle in sql in 1 line?
similar to
select nextmonth(199812)
will display 199901
select case when startmonth % 100 = 12 startmonth - 11 + 100 else startmonth + 1 end
Comments
Post a Comment