on 2024 Jan 31 4:46 AM
Hello,
I wish to remove hours, minutes and seconds from the value returned by 'currentdate'.
I do not mean format the date to hide the hours minutes and seconds using formatedate()
I wish to take the currentdate() valuesand change it so that the HH mm ss = 00 00 00
I was thinking I could take currenttime() convert that to 'X' seconds, then use relativedate to subtract the X seconds from currentdate.
Not sure how to implement this. Using Business Objects BI 4.3
There are two solutions for this:
First Solution:
As you mentioned, convert the current time to seconds and subtract the time from the current date using relative date
v_CurrTimeInSec:
= ToNumber(Substr(FormatDate(CurrentDate();"HH:mm:ss"); 1 ; 2 )) * 60 * 60 + ToNumber(Substr(FormatDate(CurrentDate(); "HH:mm:ss"); 4 ; 2 )) * 60 + ToNumber(Substr(FormatDate(CurrentDate(); "HH:mm:ss"); 7 ; 2 ))
v_BeginOfDay_1
=RelativeDate(CurrentDate();-[v_CurrTimeInSec];SecondPeriod)
Second Solution: (the easiest)
v_BeginOfDay_2
=ToDate(FormatDate(CurrentDate(); "dd-MM-yyyy") + " 00:00:00"; "dd-MM-yyyy HH:mm:ss")
...
I hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
10 | |
8 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.