Retrieving time value using getTimestamp

Hi, I like to retrieve date fields from Oracle9i database using getTimestamp. This works fine if the Date field has a date in it, or is null. However , if I try to retrieve a date field which only has a time component , say it is being used to store someones start time for their job (:-((((, then it fails with a format exception.
I can obviously use some other get , but why shouldn't I be able to retrieve a pure time value from a date using getTimestamp (0900 AM).
Is there any other way which would let me retrieve this using getTimestamp. I would like to keep all my date/times get and sets from the database as Timestamps.
Thanks in anticipation , Colin C
Exception was .... java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff; nested exception is:
     java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

Hi Colin,
I just answered this very same question you asked in Oracle's Technet forum. I will explicitly state what I implicitly hinted at in that response.
If you supply details of your platform/environment, plus the full error message and stack trace you are getting, as well as the part of your code that you believe to be causing the problem, I may be able to help you resolve it.
Good Luck,
Avi.

Similar Messages

  • Retrieving the value using formatted search

    Hi everyone. I have a question regarding on how I can get the value of the user-defined field in the title of a marketing document. I would like to get the value using formatted search and sql query.
    Here's the format I am currently using.
    $[$ <Item>.<Pane>.<Variable>]
    Is my format correct? Thanks.
    Regards,
    Omann

    Hi Omann,
    You can refer to fields in an entry screen using the syntax
    $[Table name.Field name]
    The table name is the name of the table belonging to the entry screen, for example, OINV for the A/R invoice entry screen.
    You can also use the fieldu2019s item number and fieldu2019s column number to refer to a field on the entry screen. By doing this, the query applies to all document entry screens. The syntax is then
    $[$Fieldu2019s item number.Fieldu2019s column number.NUMBER/CURRENCY/DATE/0]
    The system is able to uniquely identify each field of a document using the fieldu2019s index number and fieldu2019s column number. If you have activated the debug information under View  Debug Information, the system displays the fieldu2019s item number and the fieldu2019s column number in the status bar.
    You use the NUMBER parameter if the field concerned contains an amount and a currency key, and you want to extract the amount only. 
    You use the CURRENCY parameter if the field concerned contains an amount and a currency key, and you want to extract only the currency key.
    You use the DATE parameter if the field concerned is a date field and you want to use it for calculations.
    Regards, Yatsea

  • Retrieve Distinct Values using XQuery

    The following query is returning me duplicate rows. How can we retrieve the distinct values? Can we use Distinct somewhere in this query? Please help me.
    SELECT XMLQuery('<Update>
    { for $demo in (ora:view("TableA")),
    $demo_audit in ora:view("TableA_AUDIT")
    let $demo_id := $demo/ROW/ID/text(),
    $demo_audit_trans_date := $demo_audit/ROW/DATE/text(),
    $demo_audit_id := $demo_audit/ROW/ID/text(),
    $demo_audit_type := $demo_audit/ROW/TYPE/text()
    where $demo_id = $demo_audit_id and
    $demo_audit_type = "U"
    return
    <result>
    <type>U</type>
    <id>{$demo_id}</id>
    </result>}</Data>' RETURNING CONTENT)
    FROM dual;

    Geoff,
    I tried distinct-values in both let and return; however the result isn't distinct. Is the usage correct?
    SELECT XMLQuery('<Update>
    {for   $a in ora:view("EMP")
           let   $a_empno         := distinct-values($a/ROW/EMPNO/text()),
                 $a_ename         := $a/ROW/ENAME/text(),
                 $a_job           := $a/ROW/JOB/text(),
                 $a_mgr           := $a/ROW/MGR/text(),
                 $a_deptno        := distinct-values($a/ROW/DEPTNO/text())
           return
           <op>
                 <empno>{distinct-values($a_empno)}</empno>
    <name>{$a_ename}</name>
    <deptno>{distinct-values($a_deptno)}</deptno>
    </op>}
    </Update>'
    RETURNING CONTENT)
    FROM dual;
    The output generated is given below:
    <Update>
    <op>
    <empno>1</empno>
    <name>Henry</name>
    <deptno>10</deptno>
    </op>
    <op>
    <empno>1</empno>
    <name>Henry1</name>
    <deptno>10</deptno>
    </op>
    </Update>

  • How to retrieve DB values using select-options

    Hi all,
            I have problem to run this code for getting select option values in runtime.  Is there any function, methods or structure to know this?  I didnot get DB values when I click select-option button.
            I would like to display DB field values when i click select-option pushbutton.  select-option values while programs working in runtime.
    Example Code:
    REPORT  ZBAPUSHBUTTON.
    data: lryrctno type ZLRYRCT-ZEBELN,
          LDRIVER_FN type ZLRYRCT-DRIVER_FN,
          LZDELDT TYPE ZLRYRCT-ZDELDT,
          LZLRYNO TYPE ZLRYRCT-ZLRYNO,
          LZDRIVERID type zlryrct-ZDRIVERID.
    DATA: LRYRCT TYPE ZLRYRCT.
    SELECTION-SCREEN PUSHBUTTON 10(10) LB1 USER-COMMAND PB1.
    SELECTION-SCREEN PUSHBUTTON 25(10) LB2 USER-COMMAND PB2.
    SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE T1.
    PARAMETERS: PLRYCTNO like lryrctno,
              PDR_FN LIKE LDRIVER_FN,
              PZDELDT LIKE LZDELDT,
              PZLRYNO LIKE LZLRYNO.
    SELECTION-SCREEN END OF SCREEN 100.
    SELECTION-SCREEN BEGIN OF SCREEN 200 TITLE T2.
    select-options: slryctno for lryrctno,
                    sdr_fn for ldriver_fn,
                    szdeldt for lzdeldt,
                    szlryno for lzlryno,
                    pzdrid for lzdriverid no intervals.
    SELECTION-SCREEN END OF SCREEN 200.
    INITIALIZATION.
    T1 = 'SELECT CHECK BOX AND RADIO BUTTON'.
    T2 = 'SELECT PARAMETERS'.
    LB1 = 'PARAMETER'.
    LB2 = 'SELECT-OPTION'.
    AT SELECTION-SCREEN.
    CASE SY-UCOMM.
    WHEN 'PB1'.
    CALL SELECTION-SCREEN 100.
    select single * from zlryrct into lryrct where zebeln = plryctno.
        if sy-subrc = 0.
          message 'primary key already exists. enter different lorry rect. no.' type 'W'.
        endif.
        LRYRCT-ZEBELN    = PLRYCTNO.
        LRYRCT-DRIVER_FN = PDR_FN .
        LRYRCT-ZDELDT    = PZDELDT.
        LRYRCT-ZLRYNO    = PZLRYNO.
        INSERT INTO ZLRYRCT VALUES LRYRCT.
        if not sy-subrc = 0.
          MESSAGE 'Insert not possible' TYPE 'W' .
        endif.
    WHEN 'PB2'.
    CALL SELECTION-SCREEN 200.
        select * from zlryrct into lryrct where
                 zebeln in slryctno and
                 driver_fn in sdr_fn and
                 zdeldt in szdeldt and
                 zlryno in szlryno.
          write: / lryrct-zebeln, LRYRCT-DRIVER_FN, LRYRCT-ZDELDT, LRYRCT-ZDELDT, LRYRCT-ZLRYNO .
        endselect.
    ENDCASE.

    What you are looking for is called "search help" (SE11 transaction), you may reuse an existing one (it must be attached to data element, or structure component as foreign key, etc.) Please look at SAP documentation and forums. You may also program it yourself by using AT SELECTION-SCREEN ON VALUE-REQUEST FOR ...

  • BUG: retrieving NCHAR value using ViewObject returns "???" with OCI driver

    Hi,
    after upgrading JDeveloper to 10.1.3.1 we cannot use OCI JDBC drivers, because they don't work correctly - characters, that do not exist in database character set (EE8ISO8859P2 in our case) are converted to "?". Thin driver works well. We need to use OCI, because we had some issues with RAC with thin driver.
    Test case is easy: create table with NCHAR column, populate with unicode data, create ViewObject to select from this table and it will work only with THIN and not with OCI driver. This worked well with 10.1.3.0. When I tried to directly connect to DB and select that table using java.sql.Statement, it worked with both drivers, that's why I suspect the mechanics inside ADF BC.
    I logged a SR for this in Metalink, but try this way as well, for someone else could hit the same problem.
    Thanks for any help,
    Viliam

    Hi,
    after upgrading JDeveloper to 10.1.3.1 we cannot use OCI JDBC drivers, because they don't work correctly - characters, that do not exist in database character set (EE8ISO8859P2 in our case) are converted to "?". Thin driver works well. We need to use OCI, because we had some issues with RAC with thin driver.
    Test case is easy: create table with NCHAR column, populate with unicode data, create ViewObject to select from this table and it will work only with THIN and not with OCI driver. This worked well with 10.1.3.0. When I tried to directly connect to DB and select that table using java.sql.Statement, it worked with both drivers, that's why I suspect the mechanics inside ADF BC.
    I logged a SR for this in Metalink, but try this way as well, for someone else could hit the same problem.
    Thanks for any help,
    Viliam

  • How to retrieve multilpe values stored in driectory entry

    Hi all,
    I have managed to add an entry which containing multiple values for an attribute to the OiD. I am also able to retrieve those values using Sun's JNDI API's. The problem is when i am retrieving duplicate values in the entry. The Attributes.get() returns only the distinct values.
    The Attribute definition is
    attributetypes: ( 2.1.5.5.2.8.3.3.5.3 NAME 'employeeSpecialAllowance' DESC 'Employee Special Allowance' ORDERING numericStringMatch SYNTAX '1.3.6.1.4.1.1466.115.121.1.36' USAGE userApplications )
    The duplicate values what i mean here is, suppose if the attribute has values like
    employeeSpecialAllowance: 1000
    employeeSpecialAllowance: 2000
    employeeSpecialAllowance: 1000
    employeeSpecialAllowance: 3000
    The Attributes.getAll() retrieves only 1000,2000 and 3000. The second instance of 1000 is not retrieved. The attributes were created specifying its ordered type set to true like this
    attr = new BasicAttribute("employeeSpecialAllowance",10000,true);
    Can anybody provide me an insight into this?
    Thanks in advance,
    Cheeka

    The Attributes.get method in JNDI does not support this. That is why you are only able to fetch non-unique values. It is not a problem with OiD.

  • Attribute calc and retrieval time

    I have built an outline that consists of 7 standard dimensions. The last dimension is a base dimension with 15 attributes. This base dimension lists SSN# identifiers, but has their characteristics, such as age, race, rank, occupation, etc as attributes. There is a total of 100,000 different individuals all with varying combinations of characteristics. Right now the calc time is around 2 1/2 hours, and data retrieval on some characteristics takes several minutes. I know there are some obvious flaws in this design, but could someone tell me what they are and what I could do to correct them. I would greatly appreciate it.

    Hi,go through this online documentation for optimizing the retrieval times based on the attibute dimensions position on the outline.http://www.essbase.com/doc/essbase-62/dbag/dindesin.htm#4364Jaya---Message Posted by hwinsch   3/25/02 07:13---Does anyone have suggestions on how to improve retrieval time when using attributes?

  • Retrieve alert values for use as parameter in corrective action sql script

    I am trying to write a corrective action sql script to kill a session that is blocking other sessions. I have the "blocking session count" metric set and the alert is firing correctly.
    Is there any way to retrieve the sid and serial number from the alert generated and use it in a corrective action sql script?
    Here is the alert generated:
    Target Name=myproddb.world
    Target Type=Database Instance
    Host=myprodserver
    Metric=Blocking Session Count
    Blocking Session ID=SID: 522 Serial#: 5228
    Timestamp=Mar 4, 2008 5:57:12 PM EST
    Severity=Warning
    Message=Session 522 is blocking 1 other sessions
    Notification Rule Name=Testing Corrective actions
    Notification Rule Owner=sysman
    Clearly the sid, and serial # is contained within the alert Message field
    what I want to write for the sql script is :
    alter system kill session '%sid%,%serial_no%' immediate;
    and have GC pass in the sid and serial_no to the script.
    The "Target Properties" listed on the right of the Edit Corrective Action screen lists minimal details pertaining to the alert and certainly not the session sid, serial no.
    Generically, is there any way to retrieve the values from an alert and use them in a corrective action script or job?
    I've looked into getting the values from the mgmt$alert_history table, but I'm hoping that GC can pass the values to the sql script.
    thanks in advance for your help.

    Hi
    You can implementing a procedure like this.
    1. When a block session count alarms occurs, there is a column in the v$lock that you can examine.
    #!/bin/ksh
    #kill_block_session.sh
    #first export your variables
    export ORACLE_HOME=/oracle/product/10.2.0.3
    export ORACLE_SID=SIDNAME
    $ORACLE_HOME/bin/sqlplus "/ as sysdba" << EOF
    execute immediate killed_blocks;
    EOF
    # end
    The killed_blocks is a procedure:
    create procedure
    declare
    v_sid varchar2(15);
    v_serial varchar2(15);
    -- now a sql query that retrieve the sid and serial
    -- you can obtain these values from v$session and v$lock
    select vs.sid,vs.serial into v_sid,v_serial
    from v$session vs,v$lock vl
    where vs.sid=vl.sid
    and vl.block >0
    -- After this, you execute a dbms_put line with these
    -- values
    But you understant that this response action is very dangerous, because its possible that you kill sessions that the blocking are transitient.
    You must examine your enviroment and your application and establish the metric like UDM and not for only session blocking count.
    You must to see:
    - The type of block
    - The ctime time in the v$lock for to understatn the amount of time to determine that the block is need killed.
    - In my opinion you need a special UDM and deactivate the blocking sesion count
    If you want help to create this UDM send me a mail to [email protected]
    Regards
    Robert

  • Using a SelectOneChoice to retrieve a value in to a variable...

    AAAAaaah. I've spent far too much time on what should be a very simple operation - can somebody help me....
    (JDeveloper 10.1.3.4. Oracle ADF on Oracle ADF BC.)
    I have a backing bean called HspShopBacking with a simple Date variable "selectedTime":
    public class HspShopBacking
      private oracle.jbo.domain.Date selectedTime;
      getSelectedTime(){...}
      setSelectedTime(oracle.jbo.domain.Date selectedTime){...}
    }I would like to use a SelectOneChoice to display a list of times from my ViewObject: DELIVERY_TIMES and retrieve the value in to my selectedTime attribute.
    Unlike most of the examples I can find I DON'T want my SelectOneChoice to have an existing Iterator as it's base datasource and then to retrieve the selected value from that iterator (because I've got various commits happening that might commit the updated value).
    In Forms this was SO easy.....can somebody PLEASE point me in the direction of the relevant documentation or tell me what I need to do!!

    I have a habit of answering my own questions ... these are the steps I took for retrieving a value from a SelectOneChoice component in to an individual variable, accessible from a backing bean (see the bottom of this post for links to the other posts that assisted me):
    As an example, assume that I have Emp and Dept view objects in my model. I want a SelectOneChoice of departments that will take the selected Department Name in to a separate variable for access in the backing bean (and therefore will not use the Emp view at all).
    1) To easily create a SelectOneChoice object (rather than try to create it manually), open the Emp view's data control up in the Data Control pallette and drag the Deptno column on to your JSPX (somewhere within the af:form tags). This is just so we can create the control using the wizard, we will be removing all references to Emp later.
    2) From the context menu choose Single Selections->ADF Select One Choice
    3) Select the Dept view iterator as the List Data Source
    4) For now (to complete the wizard) select Deptno from the Base Data Source Attribute list, and choose Deptno from the List Data Source Attribute list (we will be changing these values in the XML once the wizard is complete).
    5) Set the display attribute to Dname
    6) Click OK
    7) Open the source of the JSPX page where you created your SelectOneChoice right click and "Go to Page Definition"
    8) In the structure pane, Right-click on executables->Insert inside executables->variableIterator
    9) Right click on the created variables node in the Structure Pane->Insert inside variables->Variable
    10) Give your variable a name (such as selectedDepartmentName)
    11) I gave it a type of java.lang.Object (for maximum flexibility - I will be type checking inside the Backing Bean)
    12) Select the bindings node, and from the right-click menu choose Insert inside bindings->attributeValues
    13) From the wizard choose the "variables" data collection, and the attribute you named earlier (e.g. selectedDepartmentName), click OK
    14) From the source xml of the attributeValues object you just created, change the id to something meaningful (e.g. selectedDepartmentValues)
    15) In the structure pain, open the bindings node and Right click the list iterator binding that was created when you added the SelectOneChoice object (will be called something like EmpDeptNo) and choose "Go To Source"
    15) From the source xml change the IterBinding="EmpIterator" to IterBinding="variables"
    16) Change <Item Value="Deptno"/> to <Item Value="selectedDepartmentName">
    So in summary the JSPX page will have:
                      <af:selectOneChoice value="#{bindings.EmpDeptNo.inputValue}"
                                          label="#{bindings.EmpDeptNo.label}">
                        <f:selectItems value="#{bindings.EmpDeptNo.items}"/>
                      </af:selectOneChoice>The page definition will have:
    <executables>
        <iterator id="DeptIterator" RangeSize="-1"
                  Binds="Dept" DataControl="AppModuleDataControl"/>
        <variableIterator id="variables">
          <variable Name="selectedDepartmentName" Type="java.lang.Object"/>
        </variableIterator>
    </executables>
    <bindings>
        <list id="EmpDeptNo" IterBinding="variables"
              StaticList="false" ListOperMode="0" ListIter="DeptIterator"
              NullValueFlag="1" NullValueId="EmpDeptNo_null">
          <AttrNames>
            <Item Value="selectedDepartmentName"/>
          </AttrNames>
          <ListAttrNames>
            <Item Value="Dname"/>
          </ListAttrNames>
          <ListDisplayAttrNames>
            <Item Value="Dname"/>
          </ListDisplayAttrNames>
        </list>
        <attributeValues IterBinding="variables" id="selectedDepartmentValues">
          <AttrNames>
            <Item Value="selectedDepartmentName"/>
          </AttrNames>
        </attributeValues>
    </bindings>And your backing bean can access the value using:
        FacesContext fc = FacesContext.getCurrentInstance();
        ValueBinding vb = fc.getApplication().createValueBinding("#{bindings.selectedDepartmentValues}");
        AttributeBinding ab = (AttributeBinding) vb.getValue(fc);
        String dName = (String) ab.getInputValue() ;References:
    Geting variable value in backing bean
    http://www.oracle.com/technology/products/jdev/tips/mills/listvalue/listbindingvalue.html

  • When retrieving a 'date time' value, why is there a '.0' appended?

    Hi
    I am storing 'date time' values in a MySQL 'DATETIME' column.
    I retrieve the value by executing code (more or less) like this:
    ResultSet resultSet = statement.executeQuery(query);
    // other statements here...
    String theDate = resultSet.getString(i);If the 'date time' being stored is *2008-08-26 16:39:21*, the code returns this: *2008-08-26 16:39:21.0*
    Is there same 'simple' way to retrieve the value without a *.0* appended?
    Thanks
    Pete

    Hi Roy
    I'm not quite with you.
    You should get it from the database as a date object.Do you mean something like this?:
    ResultSet.getDate()This returns a java.sql.Date object.
    For presentation use SimpleDateFormatter to display it the way you want toI presume you are referring to java.text.SimpleDateFormat ? In that case I require the date as a java.util.Date object.
    Perhaps you could clarify a bit more?
    Thanks
    Pete

  • How to retrieve workbook's "Last Refreshed" value using VBA?

    Does anyone know how to retrieve a BEx workbook's "Last Refreshed" value using VBA?
    What I've done is expand upon a colleague's existing Excel VBA solution to automatically log into SAP BEx and batch process (and also schedule) the running of multiple BEx reports. As each BEx report in the queue is processed, the results of the run are written to a "Results" worksheet -- indicating whether that BEx report was processed successfully or not. I'm pretty much done, and everything works like a charm.
    Except I have one little problem remaining: during the processing of each BEx report, the SAP BEx status dialog appears, giving the user the ability to cancel the processing of that particular report, if they so desire. If the user cancels, I want my "Results" worksheet to indicate that for that report.
    At first, I thought, okay, I'll just test the return value when calling the SAPBEX.XLA's SAPBEXrefresh function. That function's return value is supposed to return the number of errors that occurred after each time SAPBEXrefresh is fired -- normally it's 0 if everything runs okay. So surely, if the user cancels, there's got to be some sort of error and the return value of SAPBEXrefresh would be > 0, right? Nope, no such luck!
    Which brings me back to my question in this post -- I found out through my company's SAP consultant that, if the user hits cancel in the SAP BEx dialog, the "Last Refreshed" value will not change. Therefore, he told me, simply test the value of the "Last Refreshed" value before and after each BEx reports' run. If the "Last Refreshed" value doesn't change, then presto, you know the user canceled.
    This is where I'm stuck. How do you programmatically get the "Last Refreshed" value? Obviously, you could write VBA code to find the first cell in the BEx report with the text "Last Refreshed" and then get the value in the adjoining cell. The problem with that is, what if, for some stupid reason, there's another cell somewhere in the BEx report with the text, "Last Refreshed". There's no way I can be sure that I've really found the "Last Refreshed" value plugged in by BEx.
    I've been looking extensively in this forum for an answer, but haven't found any. It seems like there are a lot of SAP BEx experts here, and if anyone can help me out here, I would greatly appreciate it.
    Thank you.

    Well, it was a little circuitous, but I figured out the solution to my own question.
    I recalled I had read about the sapbexDebugPrint macro in sapbex.xla in one of Peter Knoer's posts in this forum. So I thought, maybe I can use that to get the before and after refresh values of "Last Refreshed" in the workbook. Well, I was half-right: I could only use sapbexDebugPrint to get the workbook's after-refresh values of "Last Refreshed".
    But it didn't matter!
    As long as the after-refresh value of the workbook's "Last Refreshed" value was later than the after-refresh value of the previous workbook in the processing queue, I knew the refresh was successful and the user didn't cancel. There were some other logic permutations I had to factor in, but basically that was the answer.
    Here are snippets of my code from the main procedure, for anyone's who interested:
                '   **** Refresh query ************************************
                ' Get the previous "Last Refreshed" value
                ' We're going to need to compare this to the "Last Refreshed" value
                ' after running SAPBEXrefresh function to trap the possibility of
                ' the user canceling via the SAPBEx status dialog box
                PrevLastRefr = GetLastRefreshed()
                ' Reactivate the source workbook, just in case
                SourceWorkbook.Activate
                 RefreshRetVal% = Application.Run("SAPBEX.XLA!SAPBEXrefresh", True, , False)
                If RefreshRetVal% <> 0 Then
                    blnProcessingErr = True
                End If
                ' Get the current "Last Refreshed" value and compare it to the previous value
                CurrLastRefr = GetLastRefreshed()
                If CurrLastRefr = "NOT FOUND" Then
                    ' Refresh canceled
                    blnProcessingCanceled = True
                Else    ' We found a valid current "Last Refreshed" value
                    If PrevLastRefr = "NOT FOUND" Then
                        ' Refresh okay
                        blnProcessingCanceled = False
                    Else
                        If CDate(CurrLastRefr) > CDate(PrevLastRefr) Then
                            ' Current "Last Refreshed" value is later than previous value,
                            ' so refresh okay
                            blnProcessingCanceled = False
                        Else
                            ' Refresh canceled
                            blnProcessingCanceled = True
                        End If
                    End If
                End If
                ' Reactivate the source workbook, just in case
                SourceWorkbook.Activate
    And here's my function which retrieves the "Last Refreshed" value by calling sapbexDebugPrint macro in sapbex.xla:
    Function GetLastRefreshed() As Variant
    ' Get the SAP BEx "Last Refreshed" value by calling
    ' SAPBEx.xla's sapbexDebugPrint procedure and creating
    ' the special diagnostic workbook.
    On Error GoTo GetLastRefreshed_Error
        Dim TextCell As Range
        Dim TextCellAddr$
        Dim TextCellRow%, TextCellCol%
        Dim LastRefreshedVal As Variant
        Dim NumWorkbooks%
        ' Initialize
        GetLastRefreshed = "NOT FOUND"
        LastRefreshedVal = "NOT FOUND"
        ' Turn off screen updating until the end
        Application.ScreenUpdating = False
        ' Get the number of currently open workbooks
        NumWorkbooks% = Workbooks.Count
        ' Call the SAPBEx.xla's sapbexDebugPrint procedure
        ' This'll create a diagnostic workbook with all the information
        ' about the BEx query that was previously refreshed
        Application.Run "SAPBEX.XLA!sapbexDebugPrint"
        ' Let's double-check that the diagnostic workbook actually
        ' got created
        ' If there's any error at this point or if the number of workbooks
        ' isn't more than it was a moment ago, raise custom error
        If (Err.Number <> 0) Or (Not (Workbooks.Count > NumWorkbooks%)) Then
            Err.Raise vbObjectError + 513, , "sapbexDebugPrint failed to create the diagnostic workbook"
        End If
        ' We'll need to look at a worksheet named "E_T_TXT_SYMBOLS"
        ' in the diagnostic workbook
        ' If this worksheet doesn't exist, then we know that there
        ' was no previously refreshed query during this session
        ' (We could loop through the collection of worksheets in the workbook
        ' to see if that worksheet actually exists, but we'll use
        ' error handling to deal with this instead)
        ' Find the first cell in the "E_T_TXT_SYMBOLS" worksheet
        ' with the text "Last Refreshed"
        ' (If the worksheet doesn't exist, an error will be thrown...)
        Set TextCell = Sheets("E_T_TXT_SYMBOLS").Cells.Find(What:="Last Refreshed", _
                    LookIn:=xlValues)
        If TextCell Is Nothing Then
            ' Can't find the cell, so we know the user had canceled during previous refresh
            LastRefreshedVal = "NOT FOUND"
        Else
            ' Found the cell, now we're in business
            TextCellAddr$ = TextCell.Address ' $F$11
            TextCellRow% = CInt(Mid(TextCellAddr$, InStr(2, TextCellAddr$, "$") + 1))
            TextCellCol% = ColRef2ColNo(Mid(TextCellAddr$, 2, InStr(2, TextCellAddr$, "$") - 2))
            ' The cell with the "Last Refreshed" value is going to be 2 columns to the right
            LastRefreshedVal = Sheets("E_T_TXT_SYMBOLS").Cells(TextCellRow%, TextCellCol%).Offset(0, 2).Value
            ' Ensure the "Last Refreshed" value is a valid date/time
            If Not IsDate(LastRefreshedVal) Then LastRefreshedVal = "NOT FOUND"
        End If
    GetLastRefreshed_Exit:
        ' Err.Number -2147220991 is my custom raised error:
        ' "sapbexDebugPrint failed to create the diagnostic workbook"
        If Err.Number <> -2147220991 Then
            ' Close the diagnostic workbook and return Last Refreshed value
            Workbooks(ActiveWorkbook.Name).Close SaveChanges:=False
            GetLastRefreshed = LastRefreshedVal
        End If
        Application.ScreenUpdating = True   ' Turn on screen updating
        Exit Function
    GetLastRefreshed_Error:
        Select Case Err.Number
            Case 9  ' Subscript out of range (which means "E_T_TXT_SYMBOLS" worksheet doesn't exist)
                LastRefreshedVal = "NOT FOUND"
            Case Else
                MsgBox "Error encountered during getting Last Refreshed value." & vbCrLf & vbCrLf & _
               "Error: " & Err.Number & " - " & Err.Description, vbExclamation, gstrErrBoxTitle
        End Select
        Resume GetLastRefreshed_Exit
    End Function
    Like I said, the solution was a little circuitous, but it works!

  • Using COUNTIF on time values in pop-up menu (employee schedule template)

    I have modified the Numbers employee schedule template to my liking and it works very well. I would like to add a column to the beginning which shows, at a glance, how many people I have scheduled for AM shifts and PM shifts on a given day. My AM shifts start at 9:00 AM and my PM shifts end at 6:30 or 8:30 PM.
    So I thought I could use COUNTIF, but after I set the array, I cannot get the condition right to return anything except "0". How do you make it detect the appropriate times? The times in each cell for In and Out times are selected using a pop-up menu, just like the template.
    Here is what I tried: =COUNTIF(E3:AE3,"9:00 AM")
    What should the condition be to return a proper count?

    ac,
    You shouldn't feel badly about having trouble with this template. It is a rather tricky one. The values in the Pop-Up menus are Date/Time values. That is to say, they have year, month, day, hour and minute components, even if only the hours and minutes are displayed. So if you only compare to the hours and minutes, you will never get a match.
    I don't know if you have experienced this yet, but when you changed the Pop-Up menu content, you probably entered the current year, month and day unknowingly and will have trouble doing math against the Pop-Up content that was originally in the template.
    My suggestion in your case would be to convert the time references to decimal hours before doing a comparison. For instance, if the time you wish to compare to is in cell C4, you could extract the decimal hours with =HOUR(C4)+MINUTE(C4)/60
    Remember that the hours will reflect a 24-hour day, so times in the afternoon will run from 12.0 to 23.99...
    Then after converting to decimal, instead of using "9:00 AM" for the COUNTIF criteria, use 9.
    There are probably ways to do this using the Duration format as well, but I prefer the decimal hours.
    Hope this helps.
    Jerry

  • How can I use two drop down lists for one time value?

    I want to enter the length of time that someone does an activity in hours and minutes using two drop down lists, then enter them as a single time value (H:i:s) in Mysql.
    I've used the basic drop down lists, and a few different variations of the following with no success (seconds is a hidden field with a value of "00"):
                           GetSQLValueString(strftime('%H:%i:%s', strtotime($_POST["sleeptimemin"]." ".$_POST["sleeptimehr"]." ".$_POST["seconds"])), "date"),
    This returns 00:00:16, no matter what is selected on the drop down list.
    Any help would be appreciated.

    MySQL stores times in human-understandable format, using the 24-hour clock.
    GetSQLValueString($_POST['sleeptimehr'] . ':' . $_POST['sleeptimemin'] . ':00', "date"),

  • How do I retrieve data from a 500 GB Time Machine used as external hard drive?

    I have a very particular situation. For several years I used a 500GB Time Machine as a wi-fi broadcaster, a back up, and also as external storage for iTunes - I 'partitioned' it to allow for it's use as an external drive.
    Fast forward, and I've replaced the Time Machine with a new 3 TB Time Machine, as well as purchased a separate external drive (3 TB Western Digital) to store my iTunes files (so I no longer need to partition). The new Time Machine is my wi-fu hub.
    The problem: I need to retrieve the 300 gb of audio files that are on my old partitioned Time Machine, and move them to my new WD external drive. I've already set up the new Time Machine as my wi-fi broadcaster, and de-activated the old Time Machine.
    (I had tried to move the files previous to setting up the new Time Machine, but I realized after de-activating it that I wasn't as thorough as I thought, so I need to go back and move them again.)
    I've tried to re-connect to the old Time Machine using an ethernet cable, but when I do, it recognizes it as my wi-fi hub, and it screws up my network - it suddenly allows me access to the old Time Machine, but blocks access to the new WD external drive.
    So in a nutshell - I need to be able to connect the old Time Machine to my laptop (a Macbook running OS X 10.7.5) and have my new network see it as just an external drive - so I can then move the 300 GB of audio files directly on to my new WD external drive.
    Any thoughts on how I can do this?

    Why not connect both drives to the computer, turn off the wi-fi, and then copy the files over. Or you can use Disk Utility/Restore to move the files. See the note - it will erase the WD drive.
    You can then set things back to the way you want them. You should have more than one back up as hard drives do fail. In this case, you could use a clone and keep it on the WD drive.
    Clone  - Carbon Copy Cloner          (Often recommended as it has more features than some others)
    Clone – Data Backup
    Clone – Deja Vu
    Clone  - SuperDuper
    Clone - Synk
    Clone Software – 6 Applications Tested
    Commonly Used Backup Methods

  • Report Retrieval Times in BPCv7 SP3 using SQL 2008

    General Information: We are a two server environment, one WEB and one SQL, using SQL 2008. We are using BPC v7 SP3. In our devlopment environment, we have selected a handful of reports to use as a benchmark against our production version of Outlooksoft version 4.
    Problem: The benchmark reports are taking longer to retrieve in BPC v7 then they are in Outlooksoft version 4 SP9. We have stripped out the dimension formulas, unchecked the INAPP for each dimension property, reset the compatability level in SQL, and removed all data from the facttables in BPC version 7. The initial pull of the report seems to take almost 3 times as long in BPC v7 than in Outlooksoft version 4. Subsequent pulls, changing the date, take less than 15 seconds for the same report.
    We are at a stand still trying to figure out why we are experiencing such lengthy retrieval times in the initial pull of a report in BPC version 7.
    Additional Info: In our development environment of BPC v7, we currently have only 4 users set up to test. Our Outlooksoft version 4 has a total of 186 users. I don't know the maximium concurrent users we may have at one time.
    Question: We are wondering if any other users are experiencing the same issue when they try and retrieve data from a report in BPC version 7? Please share your insight to this problem.

    Hi Irene,
    It is a big diference of design between 4.x and 7.x.
    Into 4.x when you pull data into a report actually you are using PTS from client and you already have the connection and everything from client direct to OLAP server.
    In 7.x all the request are going first to application server and the application server is the one taking the data from OLAP and after that data is sent to client.
    So first time when you are doing refresh of report into application server it is necessary to create instances for all COM+ components necessary connection etc...and in that case the reports is taking longer.
    When you are doing other refresh with the same reports or with other the time for refresh is much faster because already the COM+ instances were created and in this case the reports should be faster than v 4.x
    So I suggest to try the follow test.
    after login with BPC client just open first a small reports which you know is not taking too long.
    After that open your big report. It should retrieve data faster than 4.x or almost the same time.
    Also make sure you have all the settings done from Tunning Guide for BPC 5.x ( these settings can be applied also for 7.X)
    to be sure that your 7.0 environment is working properly. This tunning guide can be found into bpx/sdn HTG section.
    I hope this will help.
    Regards
    Sorin Radulescu

Maybe you are looking for

  • How to write a recovery disc in my hp probook 4530s?

    i have baught this probook 4530s from Dubai.. and i didnt know how to write a recovery disc in dvds...? So plz help me? or should i get the recovery dvds from hp office?

  • After itune 11.1.5.5 in windows 8.1 installed, my iphone 5 is not recognizedd by iTune.

    first time iTune caused an issue. Iphone 5 is not recognized by itune for first time after iTune update to 11.1.5.5. surprise ! I really disappointed and feel like Windows PC crash on me. A posted solution is too technical to me and can't follow. rei

  • Bridge 6 not reconized in cs 6

    I removed cs3,4,5 from my computer as I have cs6 installed.. Everytime I click on a photo in the bridge it keeps giving me an error Windows cannot find C:\program files\adobe\adobe photoshop CS4(64bit\photoshop.exe. How to I change it.

  • Moving and Tilting the Camera for an optimum Lens Profile Creator image set

    When framing the chart in different areas of the image frame, use a combination of physically moving and tilting the camera to achieve an optimal balance for LCP generation. The following two passages are from the AdobeLensProfileCreatorCalibrationCh

  • Crushing plant scenario mapping

    Hello Experts, One of our client to use SAP for Crushing plant, where the huge rocks are crushed in to Specific sizes of Aggregate (Output material) i.e. Aggregate 40 mm, 20mm and aggreate 10 mm get Produced. ROCK BLASTING CRUSHING SCREENING How shou