Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I run into a little problem dealing with dates. I leave below a table in which you can see the date field
I'm trying and some of the tests I've already done.
The field in question is the first to appear in the table and, as you can see, has a date in 'YYYYMMDD' format.
What I have to achieve is to keep only the year, eliminating the part corresponding to the month and day. In columns 2,3,4,5 you can see some tests I have done.
I know that I could get the same result simply by running a left, as shown below, but I would like to know the reason why I can not do it in the way mentioned above, using date() and above all understand the reason why this date appears so strange numeric.
Thanks to all
the date format YYYYMMDD (SAP standard format) is one which cannot verify correctly without scripting
use
year(date#(ERDAT,'YYYYMMDD')) as Year,
date(date#(ERDAT,'YYYYMMDD')) as date
and so on
the date format YYYYMMDD (SAP standard format) is one which cannot verify correctly without scripting
use
year(date#(ERDAT,'YYYYMMDD')) as Year,
date(date#(ERDAT,'YYYYMMDD')) as date
and so on
It worked perfectly, thank you very much for the explanation. Greetings