Decimal to Time format
Hi All,
I have one key figure which is in decimal format and it is displaying as the same in the query.
But my requirement is to show in hours and mins.
Ex: if 1.33 then it should show 1hr 20m or 1.20hr
if 2 then it should show 2hr
if 3.5 then it should show 3hr30mins
if .50 then it should show 30mins
Plesae help me out in solving this.
Thanks
You can write a VB macro code at BEx analyzer level to display the output in that format.
Similar Messages
-
Hi all
Does anyone know how to format time format to decimal number?
Eg: '10:21' in HH24:MI to 10.21
'21:09' to 21.09
Thanks in Advance
PrashSince you just want to replace the colon with a period in a string, just use the string replace function:
select replace('10:21',':','.') from dual;However if you convert this to a number, then as Boneist said it's not really comparable to the time portion of a date as 21 minutes is not 21/100 of an hour but is rather .35 hours (21/60). You won't be able to use this decimalized format as a meaningful number, nor will you be able to do any sort of date based arithmatic on it.
You may be better off converting your string to date, then into a number via some date math:
with sample_data as (select to_date('11:21','HH24:MI') dt from dual)
select dt, (dt - trunc(dt))*24 from sample_data;Edited by: Sentinel on Nov 10, 2008 9:40 AM -
Change decimal format to time format ie 1.5 to 1:30
Hi I need to create a field such that when you enter a value in decimal format it gets converted to time format.
Eg change 1.5 to 1.3 ..... Can any one help cheers.... any light on how to do this would be much appreciated.create table num_to_time (seq number, val number, dtvl date);
insert into num_to_time
select 1 seq, 1.5 val, null dtvl from dual
union all
select 2, 2.25, null from dual;
commit;
create or replace procedure p_numtotime is
v_seq num_to_time.seq%type;
v_val num_to_time.val%type;
v_date num_to_time.dtvl%type;
cursor c1 is select * from num_to_time;
begin
open c1;
loop
fetch c1 into v_seq,v_val,v_date;
exit when c1%notfound;
update num_to_time set
dtvl = to_date(to_char(trunc(sysdate)) ||
' 0'||trunc(v_val)||':'||to_char(mod(v_val,trunc(v_val))*60)||':00',
'dd/mm/yyyy hh24:mi:ss')
where seq = v_seq;
end loop;
commit;
close c1;
end;
exec p_numtotime;
drop table num_to_time;
drop procedure p_numtotime; -
Does anyone know of software that can create what you can do with Calendar but in a week at a glance day timer format? IE - a 5 x 7 size with photos on the left and a week calendar on the right?
Thanks!No I do not - but it sounds like a good suggestion for Apple - iPhoto menu ==> provide iPhoto feedback
LN -
During export from Discover to Excel, Time Format changes to Number Format
Hi
I have a seconds column which is of number datatype. But in my report, I am converting the number in *0HH:MI:SS* format. For example, I have *4952534 seconds*. So my report is showing *1375:42:14* which is a Time Format. It looks good when I view the data in Discoverer Viewer or Plus. But when I try to export the data to Excel, the time format gets converted to *4952534 seconds*, which is creating problems. So can you suggest on how can I preserve the formatting during export to excel from discoverer.
Thanks
SachinHi,
Excel will not implement the 0HH:MI:SS data format, it just gets the field as a number. You will have to format the field into text using the calculation from my previous post.
Rod West -
Display value in hh:mm time format in SSRS Report
Hi Everybody,
I have an SSRS report where one of the column is sum of time values. When I do the summation, the values are coming in this format. In the last column the minute value is getting displayed more than 60. How can I format it to proper time format as hh:mm
so that it displays as "08:15" . The expression which I am using is " Sum(CDec(FormatNumber(Fields!Overtime_Hours.Value,2)),"Month"). Your help would be highly appreciated.
January
31/1/2014
21/04/2014
00:00
07:75
00:00
07:75
Thanks & Regards,
RPC
Regards RCPHi RPC24,
According to your description, you can calculate the correct value of time summation. Now you want to make the result into proper time format (hh:mm). Right?
In this scenario, we can convert the time into string type, split the string based on delimiter ":" and convert each part into integer. Then do the calculation for each part and set the hour increase 1 every 60 minutes (we can adjust in expression).
We have tested this case in our local environment. Here are screenshots for you reference:
1. The report design looks like below:
A: =Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")
B:=CStr(SUM(CInt(split(CStr(Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")),":")(0)))+SUM(CInt(split(CStr(Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")),":")(1)))\60)+":"+CStr(SUM(CInt(split(CStr(Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")),":")(1)))
Mod 60)
Ps: In this sample, we used Time data type. You may need to do some modification in your expression based on the data type of the time data field.
2. The result looks like below:
Reference:
Summing the Value of HH: MM: SS In SSRS
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
How to get system time format in time stamp
Hello All,
I have one problem regarding Time stamp. I want system time stamp format in Time control. If my system date/time format change then automatically my time stamp format should also change.If my system Time stamp format is hh:mm:ss AM/PM dd/mm/yy so in my LabVIEW time stamp format should also same. If System time stamp format hh:mm:ss AM/PM mm/dd/yyyy so in my LabVIEW time stamp format should also same.
So Please help me its a very important for my automation application.
Thank You.
Vinal Gandhi
Kudos are always Welcome.... :-)
Vinal Gandhi, CLD
Software EngineerHi Vinal,
have you tried the FormatDateTimeString function with a standard string indicator and the "%c" formatcode as described in the help instead of the generic timestamp indicator?
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Hello,
in linksys administration guide for SPA9000 the Day time format is defined as Start time: and End time.
Is it possible to have more than one periods of Day time?
For example lets say i want to define Day time beetween 08:00 and 13:00 and also day time 14:00 until 18:00. Is that possible?
Thanks
KMHi Jeff,
thanks for the reply. Tried your suggestion but it doesnt work. As soon as first end time kicks in thats it. Night time folks until the next day.
KM -
Time Format using text variable with replacement path
Hi Friends,
I've used "Text variable with replacement path" to make the column heading dynamic by replacing the values referring from "0calday"...
everything is working fine, but here it is displaying the time format like
YYYYMMDD (20030101), i want it to be displayed DDMMYYYY (01012003) in the column heading... how to make it possible?
pls waiting for ur inputs, it's an urgent...
Regards,
PattnaikHi Satyakam,
In the text variable properties make sure that in the replacment path you have chosen "Text" to appear date as per user setting . Other wise as in your case it must be set to "Key" which always shows in the format YYYYMMDD.
Hope that helps.
Regards
Mr Kapadia -
Data services with SQL Server 2008 and Invalid time format variable
Hi all
Recently we have switched from DI on SQL Server 2005, to DS(Date Services) on SQL Server 2008. However I have faced an odd error on the query that I was running successfully in DI.
I validate my query output using a validation object to fill either Target table (if it passes), or the Target_Fail table (if it fails). Before sending data to the Target_Fail table, I map the columns using a query to the Target_Fail table. As I have a column called 'ETL_Load_Date' in that table, which I should fill it with a global variable called 'Load_Date'. I have set this global variable in the script at the very first beginning of the job. It is a data variable type:
$Load_Date = to_char(sysdate(),'YYYY.MM.DD');
When I assign this global variable to a datetime data type cloumn in my table and run the job using Data Services, I get this error:
error message for operation <SQLExecute>: <[Microsoft][ODBC SQL Server Driver]Invalid time format>.
However I didn't have this problem when I was running my job on the SQL Server 2005 using Data Integrator. The strange thing is that, when I debug this job, it runs completely successfully!!
Could you please help me to fix this problem?
Thanks for your help in advance.Thanks for your reply.
The ETL_Date is a datetime column and the global variable is date data type. I have to use the to_char() function to be able to get just the date part of the current system datetime. Earlier I had tried date_part function but it returns int, which didn't work for me.
I found what the issue was. I don't know why there were some little squares next to the name of the global variable which I had mapped to the ETL_Date in the query object!!! The format and everything was OK, as I had the same mapping in other tables that had worked successfully.
When I deleted the column in the query object and added it again, my problem solved. -
Hi
I am using oracle 9i . Is there any option to change the time format ie. for eg: when iam inserting values (in the fields declared as timestamp) as '22-06-2005' it is showing errors but when changed to '22-jun-2005'it is working. In my case i want the values to be inserted in '22-06-2005' format.
Also is it posssible to change dd-mm-yyyy format to yyyy-mm-dd.
Thanking you in advance
DinnyHi
When i create a having 'ALTER SESSION SET NLS_TIMESTAMP_FORMAT = ''YYYY.MM.DD HH24:MI:SS''' the time format is not getting intialized but when i run the stmt ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'yyyy-mm-dd'; the time format is getting initialized.
SQL> CREATE OR REPLACE PROCEDURE set_date_format
2 AS
3 BEGIN
4 Execute Immediate 'ALTER SESSION SET NLS_TIMESTAMP_FORMAT = ''YYYY.MM.DD HH24:MI:SS''';
5 END set_date_format;
6 /
Procedure created.
SQL> insert into sili values('2003-05-23');
insert into sili values('2003-05-23')
ERROR at line 1:
ORA-01843: not a valid month
SQL> insert into sili values('2003-jan-23');
insert into sili values('2003-jan-23')
ERROR at line 1:
ORA-01843: not a valid month
SQL> insert into sili values('23-jan-2005');
1 row created.
SQL> ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'yyyy-mm-dd';
Session altered.
SQL> insert into sili values('2003-05-23');
1 row created.
SQL> insert into sili values('2003-jan-23');
1 row created.
Thanks & regards
Dinny -
Specifying date time format in Finder
How can I specify the date-time format in Finder for the "date-modified" and "date-created" columns in list view?
About three years ago, I got a command line instruction to set these formats and I kept it at mm/dd/yy
Then a couple days ago, I changed the date format in iStat menus and the date-time formats started acting weird. I want the dates to be like "07/08/05" (mm/dd/yy) and then the formats started changing to "November 07, 2008" (month/dd/yyyy). This change seemed to take effect any time I open the view options for a folder. Now I discovered that the date format change depending on the column width according to the format specified in system preferences, international, formats.
Narrow column, short date format; a little wider to long format, with ellipses if the column is not wide enough; then full format.
Does anyone know the command line to set the format to keep it to the one I want?this doesn't seem to be it. however I now like the way Finder does display dates -- format gets more compact as the width of the column decreases; although there still is some excess space left on the left -- perhaps for AM & PM which I don't use; I use a 24 hour time format instead.
Happy New Year -
Hi Experts,
Has anyone tried exporting the data in time format in BPC 7.0 M SP7?
I have tried using ExportFormat=MultiWithHeader and I am getting all the dimensions and also proper time format. But I want only few dimensions in column.
Say like if I have 8 diimensions then in the export file I want only 5 dimensions with data in time format.
I have tried using MVAL also but it is throwing an error i.e. "Column reference exceeds".
Please help me if anyone has done that.
Regards
PrityThis is the FCP X forum - you should ask this question in the Final Cut Studio forum:
https://discussions.apple.com/community/professional_applications/final_cut_stud io
Having said that, the render time you mention doesn't sound unreasonable - what are you expecting?
Render times depend on the amount of effects you have and the processor power of your Mac.
Andy -
Dear all,
I am having trouble displaying the value I want. I have a double value say 320 sent to a digital indicator where I have edited the properites of it to display in a time format containing only minutes and seconds like so, '3:20'. Unfortunately it'll take the value and change it to a another value and display that. I do not know what the issue is. If anyone knows the solution... PLEASE post!
There is an image attatched!
Thanks.
Solved!
Go to Solution.
Attachments:
img.JPG 24 KBI only believe so due to the fact that when I convert a value from time stamp to double such as 3:20 it gave me 320. So I thought that the reverse might be try. Should I just input the total amount of seconds and that will output the Minuteseconds that I want?
Thanks for quick reply. -
BO 3.1 WEBI Time format variable not showing correctly
Hi,
I apologise in advance. I know this topic has been covered many times in previous forums but I have been through each and I am still encountering an issue.
My requirement is to convert x number of seconds into a HH:MM:SS time format for both positive and negative numbers in WEBI.
I found a formula on a forum here that suggest using the following code:
=FormatNumber(Floor([Column_Name]/3600) ;"0") + ":" + FormatNumber(Floor(Mod([Column_Name];3600)/60);"00") + ":" + FormatNumber(Mod(Mod([Column_Name] ;3600) ;60) ;"00")
I have used this code and when I give the code an input of -720 seconds it outputs in the format -1:-12:00.
It is quite frustrating I cannot get this to the correct format, can anyone suggest what is wrong with this formula?
I am using WEBI for creating the formula on BO 3.1.
Kind Regards,,
JohnHi,
Let me try.
This is your formula.
=FormatNumber(Floor([Column_Name]/3600) ;"0") + ":" + FormatNumber(Floor(Mod([Column_Name];3600)/60);"00") + ":" + FormatNumber(Mod(Mod([Column_Name] ;3600) ;60) ;"00")
Issue with this formula is only when you have used negative seconds.I have break the formula =FormatNumber(Floor([Column_Name]/3600) ;"0") and found this is giving the wrong result.If you divide -720/3600 you will get 0.2 and nearest integer is 0 but in this case 1 is coming.
Same time it is working properly with 720 and the result will be 0.
In this case i have created one variable which convert the negative values to positive.If you enter -720 then it will convert 720 and you will get the 0 from first part.
=If([Column_Name]<0) Then ([Column_Name]*-1) Else [Column_Name]
Second part is if you entered the negative values then output should be in the negative.but with above condition you will get the positive values.
Again i have created the formula If([Column_Name]<>[Column]) Then "- which compare the object values and see if I have changed anything.
Like i have entered -720 so first variable will convert to 720 then in next formula it will check -720 is not equal to 720 (Which is not) then add - (minus sign) and same calculation else part if is equal then use the same formula which you have put.
Hope this is clear to you.
Regards,
Amit
Maybe you are looking for
-
Any other forum ???
Hello, Is there any other place on the Internet to ask questions on SAP? Particularly on: SAP Security, ABAP and XI. Thanks, Charles.
-
Package number in service entry
Hi I understand package number(PACKNO) is a unique number in service entry and also this is system generated. In my case service entry should be created automatically from a third party system. XI gets data from third party system and will put into B
-
I don't understand how to sign in to Revel using Google or Facebook
You told me to sign in with Google or Facebook but my mailing address is different on those app then the one that you got conneted to your company when I sign up on Adobe Revel. The address i sign up with is email1 NOTemail2. Plus i have already pai
-
Using Windows 7 and LR 5, when I look at the Keyword List a certain keyword has 7 pictures but when I check the Library Filter with that keyword 350 pictures are shown which includes the 7 pictures that have the keyword. Why does the Library Filter
-
Where is my quick took in fireworks cs5.1
Im trying to follow a video and they are using "quick tool" but I cant find mine. I am very new to fireworks. Thanks Karen