I have a date format cell in my table, of which I need to extract the month in two digits. This means that 6-4-2021 should return 04. The main problem is that this needs to be in the syntax of SQL-92. Any ideas on how to do this?
How to get the month of a date with two digits in SQL-92?
307 Views Asked by Emma van de Vreugde At
2
SQL-92
I had wondered if you're were really looking for ODBC functions. If so then
locate()would be the equivalent forposition(), noting that the argument syntax just uses comma separators.replace()would then also be available for an alternate approach.Looking at some reference material for your tool I would translate it this way though it does appears that there's even a
dayOfMonth()function that might make this all even simpler.SAP BusinessObjects SQL for multisource-enabled universes
https://help.sap.com/doc/4667b9486e041014910aba7db0e91070/4.2.4/en-US/sbo42sp4_info_design_tool_en.pdf
See it in action with PostgreSQL: http://sqlfiddle.com/#!17/9eecb/72962