I have date as DD.MM.YYYY how I can convert it into YYYYMM tql CONVERT() function doesn't work in ingres MySQL DATE_FORMAT also
Asked
Active
Viewed 314 times
0
-
SET date_format= 'german' comes to mind. – wildplasser Oct 20 '16 at 22:51
-
the problem i need to have it only in query not for whole DB – Andrey Oct 20 '16 at 23:39
-
What version of Ingres are you using, and is the existing dd.mm.yyyy date stored as a string or as a date? In Ingres 10.2 there is the to_char() function which might be useful, eg: select to_char('now','YYYYMM'); – G Jones Oct 24 '16 at 13:28
-
@GJones its throwing an error E_US0B5A no such function as to_char – Andrey Oct 24 '16 at 22:18
-
You're probably using an older version of Ingres in which case that function won't be available, sorry. You can check the ingres version with: select dbmsinfo('_version'); – G Jones Oct 25 '16 at 07:15
1 Answers
1
select varchar(date_part('year','01102016'))+ shift(varchar(100+date_part('mos',date('01032016'))),-1);
Here is how it was done

Andrey
- 1,629
- 13
- 37
- 65
-
Wow! Seems like a lot of work. Bet you're missing SQL Server now :) – John Cappelletti Oct 20 '16 at 22:29
-