on 03-08-2013 12:17 AM
So I have a fact table that has a date field (datatype: TIMESTAMP and it looks like this 2012-09-03 01:00:00.0. I want to create a calculated column where i truncate the timestamp portion of this.I defined a function like this: TRUNC("PROMISE_DATE",'YYYY')
But when trying to validate, get an error like this:
date(component("DATE", 1), component("DATE", 2), component("DATE", 3))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudarshan,
Somehow my reply from yesterday is not being shown.
Can you please try using leftstr(string(<date>, 4)) to get the year information.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sudharshan,
What is your requirement? Please explain your requirement so that I guide you better.
If you trying to do date logic something like below. Use as reference the below syntax without stripping the time value.
daysbetween (ADATE - now()) / daysbetween(BDATE - CDATE))
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudarshan,
Please reference the development guide from help.sap.com/hana_appliance
In section 7.5.11 you'll find all the functions that can be used in such expressions - trunc is not among them.
You should be able to convert the timestamp to date directly using the date() function.
Cheers,
Jody
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.