Seconds to Time Conversion for Display on a Cross-Tab

Post Author: [email protected]
CA Forum: Formula
I am doing a cross-tab report of login times for hours logged into a system. In the cross-tab if i use the time, I can't sum. So i have the time converted to seconds to allow for a sum and totals.  Now I need to change the display of the field to time.   When I go to my Format Field of the field in seconds, under Common tab i go to Display String.  I put in the following formula: totext((/60)/60,0,"","") & ":" & totext(truncate(remainder(/60,60)),0) & ":" & totext(remainder({Secondin_Logins.T},60),0);   My problem is it changes all to report the same time; no time is different. And the formula is wrong becuase when i do the hours if it is .501 or high it rounds up. Anyone have any solutions to convert seconds to Time?

Post Author: V361
CA Forum: Formula
Part of the probem may be the crosstab,   any way, this example uses a group but should be generic enough to give you some ideas.
whileprintingrecords;
StringVar Hours1;
StringVar Minutes1;
StringVar Seconds1;
NumberVar time2;
time2:= 0;
if Sum ({Work Time}, ) = 0 then 0 else
time2:= Sum ({Work Time}, );
If time2 <= 0 Then
"00:00:00"
Else
( Hours1:=ToText(Truncate(time2/3600),0);
Minutes1:=ToText(Truncate(Remainder(time2,3600)/60),0);
Seconds1:=ToText(Remainder(Remainder(time2,3600),60),0);
//Display the time formated.
(if length(Hours1) < 2 then '0') + Hours1 + ":" +
&#91;"0",""&#93;&#91;length(Minutes1)&#93; + Minutes1 + ":" +
&#91;"0",""&#93;&#91;length(Seconds1)&#93; + Seconds1);

Similar Messages

  • Using time delay for displaying tooltips

    Hi guys, hope you are all fine,
    I have a little problem, i need to use time delay for displaying a tooltip for a specific amount of time but i don't know what code to use.
    Can you please give me a hand? I also try to find out the right way on how i can use tooltips when using a Jpanel and paintComponent. I amcurrently using setXORMode but this is not too efficient.
    Thanks guys,
    Regards,
    John.

    Ok guys, for any other who need this info, you get time delay by this:
    try {
    Thread.sleep(time);
    } catch (Exception e) {}
    // in "time" you put an integer value which represents milliseconds

  • How to display recordnumber for each row in cross tab?

    <p>Hi.. </p><p>I am using Crystal Report XI,with the database Microsoft SQL Server. I have 2 questions regarding Cross Tab.</p><p>1. How to limiting record per row and per column in Cross Tab? For example,at one page the report printing 20 records per row and 7 records per columns.</p><p>2. I would like to display recordnumber for each row that printing in Cross tab. How crystal reports can handle this?</p><p>Can anyone can help me out on this? </p><p>Please kindly advise.</p><p>AN </p><p> </p><p> </p>

    <p>Dear Kathryn,</p><p> </p><p>I did used DisplayString as suggested by you. The result work fine until I add more data to this cross tab. I used this formula : </p><p> global numbervar pager;</p><p>recordnumber();</p><p>pager := pager + 1; </p><p>  if pager > 0 then totext(pager - 1,0)     </p><p> </p><p>The result come out in decending order for each row. </p><p>SN    Name </p><p>5       abc<br /></p><p> 4       def</p><p>3        fig<br /></p><p>2        klm<br /></p><p>1      opq</p><p> Is that anything wrong with my formula?<br /> </p><p>Please kindly advise.</p><p>-AN- </p><p> </p><p> </p>

  • Creating a header for rows/columns in cross-tab with syntax

    Hi,
    The issue is creating strings for rows or columns' headers. How can I create a formula field which contains more than one seperate string. Such as "aaa", "bbb" and "ccc" are headers and they should be in seperate columns. In short, they will behave like characteristics of one of my query's field but they are just headers of the columns.
    ..............aaa...bbb...ccc....
    row1.......x.......x........x.....
    row2.......y.......y........y.....
    Also there is another issue about the formulation again. Is there any operator that does the same job as " \n" which is used in C languages to break the line?
    before:
    aaabbb
    after:
    aaa
    bbb

    Hi Carl;
    Firstly, thanks for answering my question. To explain my problem there are two options ahead(for my first question); first one is writing down the actions step by step, the second one is posting an image file(jpeg etc) to visualize it. I think the first one will be enough. If not tell me
    Step 1- Create a cross-tab and right click and select cross-tab expert.
    Step 2- Click the button "New Formula" and write down any word(such as "Sales") between two -"- sign to make it string.Then save and close.
    Step 3- Drag and drop the created formula to "columns" section and fill the other necessary sections with your database's(such as xtreme.mdb which is famous for crystal users) fields.Don't forget to add another column value to "columns" section, since our formula has no link to database.
    Step 4- Then click OK to save the changes and lets preview the cross-tab.The result will have one top column and his child or children(that depends on your data). And this top column is behaving like a header not a field.
    Now turn the second step but write down a formula for 2 columns or more.For exmple "Sales" and "Profit".So the result will have 2 top columns and their child/children.
    My question is "what is the formula for 2 or more columns?"
    Also I couldn't get the answer for my second question. What is the meaning of expressions "\c" and ChrW(13)?
    Edited by: diabolus on Oct 30, 2009 9:39 AM

  • Display Data in Cross Tab Format...Per Quarter

    Hi Team,
    I have following issue...which i am struggling to solve...
    My current report format is
    Material Technology -  Q1(Qty) Q2(QTY) Q3(QTY) Q4(QTY) - Q1(Pirce) Q2(Pirce) Q3(Pirce) Q4(Pirce) - Q1(Rate) Q2(Rate) Q3(Rate) Q4(Rate)
    I have generated cross tab report...in which i am getting following display...
    Material Technology Q1(Qty) Q1(Price) Q1(Rate)  and so on...
    Is there any way i can get the required format...please assist..
    Q1 to Q4 - Quarter 1 to 4...
    regards
    nic

    Hi Nic,
    The problem is you have 3 measure objects available: qty, price and rate.
    If you put them in a vertical table then you will have 3 columns. As soon as you put in the quarter to create the crosstab BO will the for each quarter display the qty, price and rate.
    To solve your problem is to not create a cross-tab, but a vertical table.
    For each measure object you crreate 4 new variables (type measure) using the the formula:
    E.g. for the quantity in the first quarter you create variable like: qty_q1
    =<qty> Where (<quarter> = 1)
    The same you do for the quantities for the other quarters.
    And you do the same for the price and rate.
    Ending up with 12 new variables which you can put in a vertical table in any order you like.
    Regards,
    Harry

  • Creating Total for Discoverer Plus 10 Cross Tab

    Hi Everyone,
    Any known issue in creating total for Discoverer Plus 10g CrossTab?
    My Total did not display any value when the there is more than 1 data to be summed.
    Anyone encountered this kind of problem before?
    Any feedback is greatly appreciated! Thanks
    Regards,
    Angeline

    If attempting to calculate sum as total, try cell sum... If datapoints are a mix of detail and aggregates, try neutral aggregate for detail or better still seperate aggregate from group by items (e.g. in a cross tab worksheet, keep dimensions on the left hand side or page item and only aggregable facts in the datapoint area). Hope this helps.

  • Where to perform date conversion for display?

    Hi,
    We have started our application with operation for single country, all data located in single database. The transaction history time stored is all in GMT+8.
    However, with business expansion, we now have to cater for multiple country that is of different timezone. I need to display the transaction history in local time to the user of the different timezone.
    Gut feel says i should continue to store all the time in a single timezone (i.e. probably GMT+8 for my case). And perform conversion during for the display.
    Question is where should i be doing this? I am using Struts for web tier, EJB and Mysql. Based on MVC pattern, it seems that this should be done in Struts layer (probably DispatchAction).
    Any recommended pattern? Any idea how to handle daylight saving?

    Yes, you should store all your timestamps in the same timezone. And it would be best if your database server uses the same timezone as your application server, otherwise you could run into problems.
    Now, the java.util.Date object and its SQL relative java.sql.Timestamp consist only of a single number, which is the number of milliseconds since a certain point in time. Normally they are what you get from the database. The thing to remember about them is that they do not have a timezone. As you suspect, displaying them applies a timezone to them. If the displaying is done by SimpleDateFormat -- which it should be, whether you do it in code or Struts does it -- you just need to make sure that the SimpleDateFormat has been assigned the correct timezone. This takes care of daylight savings time as well.
    Finding out what timezone your users are in may be more tricky than you expect, but this depends on where they are located. You can't necessarily derive a timezone from a country, so you may have to ask the user what their timezone is.

  • Date conversion for display

    Hi gurus,
    I have a date which is stored as un number : 38'812
    How can I have the real date with this number ? I have to substract or divide this number by 1900** or something like that ?
    Thanks in advance
    Aleksi

    Hi Aleksi,
    Are you loading this date from flatfile?
    If so, before loading you an change the formatting of the date column in microsoft excel itself and you will get the date.
    Rightclick on the cell in excel, select format cells, Under the number tab select Category as custom and in the box provided for Type - put yyyymmdd.
    Your date will be formatted.
    Hope it helps.
    Regards.

  • Regarding hr forms of time statement for displaying in the ESS

    hi experts,
    i m trying to activate the hr-form name 'sap_tim_99_0001' by going through the tc-hrforms,but it is giving this error plz help me to sort out this probkem,
    Generated print program contains a syntax error
    Message no. HRFORMS011
    Diagnosis
    Generated print program /1PYXXFO/SAP_TIM_99_0001_PRNT contains a syntax error in line                                                 144 of include /1PYXXFO/SAP_TIM_99_0001_PRNT.

    Hi Rajat,
    I am facing same problem could please explain in details how u have solve this problem
    Thanks in advance

  • Display String in cross tab in place of blank cell

    Hi,
    I am using CR 2008  and my issue is when i run crosstab i am getting a blank values fro some data becuase which that criteria there is no data in Database . I need to display a string in that area. How can I achieve this?

    Hi Venkat,
    There is a Display String formula for fields, accessed by right-clicking the field and selecting Format Field.  This is used to tell Crystal exactly what should be displayed for the field.  Add the following logic (basic syntax):
    if CurrentFieldValue = 0 then
      formula = "your display srting"
    else
      formula = cstr(CurrentFieldValue, "0.00")
    end if
    This will cause all zero values to display as blank.  I added the "0.00" parameter to the cstr() function to show that's how you tell cstr() how you want the number formatted.  See the online help for cstr() for details.
    --Naga.

  • Print time formula error when used in cross-tab

    I have a cross-table that I'm using to calculate revenue, which is based on a conditional formula.  Within that formula is a Running Total field.  When I use this field I get the following error message: "A PRINT TIME FORMULA THAT MODIFIES VARIABLES IS USED IN A CHART OR MAP".
    My problem is that I am using the Running Total because the values are duplicated by the number of detail lines.  I think this should be a relatively easy fix, but I am stumped. 
    Thank you,
    Any help you can provide is greatly appreciated!!!
    Marlene
    Crystal Reports Professional, 11.5.8.826 (on Progress Server)

    Please re-post if this is still an issue or purchase a case and have a dedicated support
    engineer work with your directly

  • Need a multi-level control break report displaying a cross-tab for each ...

    I need a multi-level control break report that displays a cross-tab report for each
    detail and subtotal. The individual cross-tabs are no problem. There are two issues:
    1) How to get many cross-tabs (thousands) to appear in one report.
    2) How to provide cross-tabs in-line on the multi-level subtotal lines.
    Here is a concrete example.
    Suppose the data base contains this table:
    road (
    id_number number, -- this is an artificial PK
    city varchar2,
    county varchar2,
    state varchar2,
    length number,
    owner varchar2, -- roads may be owned by cities, counties, states, and others
    surface_type varchar2 -- the surface type may be gravel, asphalt, concrete, and others
    The table is populated with several million records that include every
    length of road in a US city.
    It is OK to suppose that all the attributes in all the records are not null.
    Without the PK, there would be millions of duplicates,
    which should all contribute to the summed lengths.
    The report I need is like a control break report with a detail line for each
    city together with subtotals for each county and state and
    a grand total for the US at the end.
    However, each detail and total line needs to be a cross-tab report
    summing the length over the city, county, state or US
    (whichever is called for at that location)
    for each combination of owner and surface_type.
    so the report would have the following structure:
    a city cross-tab for the first city in county 1/state 1
    a city cross tab for the last city in county 1/state 1
    a cross-tab for count 1
    a city cross tab for the first city in county 2/state 1
    a city cross tab for the last city in county 2/state 1
    a cross tab for state 1
    a cross-tab for the US
    Any suggestions will be appreciated.
    This problem comes up because my client's legacy system,
    which is being replaced,
    already has such a report (in COBOL).
    Thanks!!!
    Steve
    PS, I know one ugly way to do it. Namely, make a variable for each
    possible combination of owner and surface. Then code an ordinary control
    break report. However, I am looking for something better.

    Hi Jenna_Fire,
    According to your description, you have a matrix contains total for each group on each level. Now your requirement is, when you click on any number (data field or total), it will go to the detail report which returns all the detail information of the people
    within the group scope. For example, if you click on the total of Active users in United States, it will return the detail information of Active users in New York and Texas. Right?
    In this scenario, we should set the parameter (@Country, @State, @City) allow multiple values in both main and detail report. And in Default Value (@Country, @State, @City), query out all distinct values. In the textbox which contains
    those total values, when set use these parameters to run the report, we only need to pass the parameters of parent groups. For example, if we click on the total of Active users in New York, we only need to pass Country, State, Status to detail report, and
    in the detail report, the City parameter will use all distinct values (Default Values) because we don't pass the City parameter. We have tested this case with sample data in our local environment. Here are steps and screenshots for your reference:
    1. Create parameter Country, State, City and Status in both main report and detail report. Set both Available Value and Default Value get values from query (Create a dataset for each parameter, use "select distinct [column] from [table]" as query). Set allow
    multiple values for parameter Country, State and City in both reports.
    2. In corresponding textbox, pass appropriate parameters in go to report Action.
    4. Filter data in detail report (in where clause or using filters).
    5. Save and preview. It looks like below:
    Reference:
    Using Parameters to Connect to Other Reports
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Can anyone say what makes "preparing video for display" take more time?

    i searched old threads. the topic has been raised before but there didn't seem to be any satisfying answer... i have noticed that when i have 3 or more active video tracks and i move a shot on the timeline, i get the "preparing video for display" message. it takes about 20 second to display, which is a long time to wait for every little adjustment i try to make... and i'm not using more than 5 tracks (which doesn't seem like that much either...)
    i am using FCP 5.0.4. my whole project is 5mb and the sequence is 4 minutes long. got some effects but nothing major at this point. i'm worried it'll get much worse as i add effects and layers.
    does anyone know what may be causing this or how can i make this process faster?
    is it something that can be adjusted in the settings?
    it doesn't seem normal. i've never seen anything like this in AVID...
    thanks...

    I'm at a loss at this point.
    2 things...exactly what version of QT are you running? (may/may not make a difference)
    Then, here are a couple of links for ways to trash preferences. Since you're on FCP 5.0.4, you should be good with the Anders Holck FCP Rescue 5.
    Caveat...once you've trashed your preferences you'll need to reset them...might want to make notes of how they're set now.
    If you use FCP Rescue 5, it will enable you to create a backup of your new prefs after they've been reset, then if you ever need to trash prefs again, you simply use the 'Restore' feature to get them back the way you want them quickly.
    http://fcprescue.andersholck.com/
    http://www.digitalrebellion.com/pref_man.htm
    http://www.fcpbook.com/Misc1.html
    Hope that helps,
    K

  • Total time taken for the quiz needs to be displayed in the report

    Hi,
    I would want tthe total time taken for the quiz to be displayed in the report...Let me know if its possible

    Hi,
    Please try this.
    Define three user variables - StartTime, EndTime and Duration.
    At the start of the quiz ('On Slide Enter' of the first Question Slide). have an advanced action with the following actions.
    Assign: StartTime with cpInfoElapsedTimeMS  
    Continue
    At the end of the quiz ('On Success' or 'On Failure' of the last Question Slide or 'On Slide Enter' of Result Slide), have this advanced action.
    Assign: EndTime with cpInfoElapsedTimeMS
    Expression: Duration = EndTime - StartTime
    Expression: Duration = Duration / 1000
    Continue
    The variable 'Duration' will have the time taken by the user for the Quiz in seconds.
    Let me know if you have any queries.
    Thanks,
    Thejas

  • My recirculating pump in sub vi simulation link doesnt work in the second iteration .It opens for maybe half a second whereas i gave the time delay for 5 secs..plz help very urgent

    Hi,
         I have attached my simulation loop.In the model attached i hav eone main pump with constant rpm which drives the 5 smaller pumps and fills the tank at the same time.As soon as the tanks reach their 90% level,the valves of the five pumps close(SP1,SP2,SP3,Sp4,Sp5).After that the recirculating pumps opens for 5 secs of the first tank.As soon as the recirculation finishes,the drain valve(SV1) for tank 1 open and the volume goes to interim storage.This happens for all the remaining tanks.
    My simulation works the first time,but when the second time the loop starts,it skips the recirculation pump even though i gave a time delay for 5 secs.Plz help ..I have attached the simulation.
    Thanks,
    Rami
    Attachments:
    Spatial Logic_2_Final.vi ‏223 KB

    Rami,
    I suspect that you have a race condition. The widespread use of local variables frequently leads to race conditions. Your subVI (Spatial Logic Sub_2.vi was not included) so I cannot run the VI. You have no way of knowing whether the subVI or the inner case structure will execute first, because there is no data dependency between them.
    I think a shift register or a few and some dataflow thinking would allow you to eliminate the inner case structure, the local variables, and, probably, most of your problems.
    Some of the SPi are indicators and some are controls. How are they used?
    The last case of the inner loop retursn to Case 1. Would case 0 be better?
    As for the second time through issue, it may be related to the Elapsed time function Auto Reset. From the help file: "Resets the start time to the value in Present (s) when the Express VI reaches the Time Target (s)." If more than 5 seconds elapses between the first time you use this and the next, it will exit immediately on the subsequent calls.
    Lynn

Maybe you are looking for

  • Apps won't open and computer is slow to start up

    My mac book is screwed up. About a week ago I noticed that everything on my computer started working extremely slowly. So, I ran a verify disk in disk utility. I got a message that my start up disk had an error. So, I started up from the install disk

  • Install and config issues with Oracle Portal, Forms, Reports and Discoverer

    For a while now I've been struggling with migrating a testing database to a newer version. And right now I'm pretty much stuck at trying to configure Oracle Portal, Forms Reports and Discoverer What I've got: Windows server 2008 R2 64bit Oracle 11g d

  • How to sort a Search (in Finder) by Column?

    In Snow Leopard, you could sort the results of a Finder search by column (for example, "Date Created" or "Kind").  That appears to no longer be available in Lion. Am I missing something? Also, the Search box in Finder allowed you to filter your searc

  • Customizing Advanced Search Box

    We have a SharePoint 2010 farm. Some users complain that they have difficulty in finding documents. They get many results back and so have a hard time in searching for what they are looking for. Users search documents using Advanced Search box. I am

  • I recently had a repair...

    Hello everyone, Today I got my iBook G4 back from an AppleCare repair and I had a problem. The system ran perfectly until I came across a problem. When I had my laptop repaired, the problems were: * No power * Disc stuck in drive And I put a DVD in m