Calculate Total in Forms Builder using only dates.

I am using Oracle 10g forms builder. I need to know how the total number of hours worked by students. In the current database, only the date is saved since everyone assumes that the students work for 2 hours each day. So if a date is present in the student's record, that means the student worked for 2 hours for that date.
However,I don't know how to calculate the total number of hours. I tried using the COUNT() function from SQL and assigning it to a variable but it keeps giving me errors.
How can I calculate the total number of hours?

HI,
SQL> create table hours(h date);
Table created.
SQL> insert into hours values(sysdate);
1 row created.
SQL> insert into hours values(sysdate);
1 row created.
SQL> insert into hours values(sysdate);
1 row created.
SQL> commit;
Commit complete.
select to_char(h,'DD-MM-YY HH-MI-SS') from hours;
TO_CHAR(H,'DD-MM-
19-03-08 11-06-04
19-03-08 11-06-08
19-03-08 11-06-10
SQL> select to_char(h,'HH') from hours;
TO
11
11
11
SQL> select count(to_char(h,'HH')) from  hours;
COUNT(TO_CHAR(H,'HH'))
                     3
SQL> for Forms related questions
Forms
for SQL/PL/SQL related questions
PL/SQL
HTH

Similar Messages

  • How to make fields with Forms Builder "read only"

    Hello,
    I'd like to make the fields "date" and "user" in the news form read only so that the user cannot edit them. Is this possible and how. ?
    Andreas

    Yes its possible. You use a label instead of a field. But you need to refer to datascheme in your label.
    Example: you drag drop your field on the work page.
    You look in its attributes and copy the part datascheme reference.
    You remove the field and drop a label instead on the workfield. You refer to this datascheme instead of the fixed caption.
    Best Regards,
    Frederik

  • Is using only 'date taken' date an option I missed

    Where do the absurd dates come from?  As far as I'm concerned the only 'must have' date for a photo is the date it's taken.  It may also be nice for some to know when they modified it or imported into there library.
    What I find is that I see to what my mind is impossible dates.  Things like 'date modified'  having a date earlier than 'date created'.
    Do I have the option to just seeing the EXIF data 'date taken' & if necessary suppressing the other dates & if so how is this done?  I'm using Windows 7 64 bit & all my photographic devises record EXIF dates.
    Thanks in advance

    For clarifications on various date time tags, please refer to: http://forums.adobe.com/message/4879588
    In Organizer to see only EXIF dates, you can hide other date time fields (that is hide 'General' section and 'File properties' section under EXIF').
    ~Andromeda

  • Master-Detail Forms with read-only data in Master

    I have a Master-Detail form created in Portal in which the master has fields that have select access (this has corporate bio/demo data) with the detail section having full access (local data).
    When I go to create the form, it will not compile since it generate a DELETE code on master records.
    The view I have has a master corporate record with people in depts adding detail records.
    I am running Portal 3.0.9.

    Hi,
    This is a bug. The only workaround would be is to write your own custom event and write your own code to do all that is done in onsave.
    Thanks,
    Sharmila

  • Passing date to another form and use the date in sql statement

    hello! to all programmers
    i have some small problem that need some help.
    i want to use date value parameter from the first page in the second page sql statement but i get invalid cursor state error so if anyone can solve this problem or give me a better solution to do this process.
    thanks in advance
    p/s
    EBDATE is define as date data type in my database.
    this is part of my jsp code...
    <---------------------------------------------------------------------->
    SimpleDateFormat sdfInput = new SimpleDateFormat( "yyyy-MM-dd" );
    SimpleDateFormat sdfOutput = new SimpleDateFormat ( "dd/MM/yyyy" );
    String date= request.getParameter("date");
    Date date1 = sdfInput.parse(date);
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:wtmis_db","","");
    Statement stmt=con.createStatement();
    ResultSet set=stmt.executeQuery("select * from ELECTRICBIL where EBDATE="+sdfOutput.format(date1));
    if (set!=null)
    set.next();
         Date bildate =set.getDate ("EBDATE");
         Date sdate =set.getDate ("EBSTARTDATE");
         Date edate =set.getDate ("EBENDDATE");
         int kw =set.getInt ("EBKILOWATT");
         int maxdemand =set.getInt ("EBMAXIMUMDEMAND");
         int days =set.getInt ("EBDAYS");     
    <---------------------------------------------------------------------->

    Try this
    <%
    while(set.next())
    Date bildate =set.getDate ("EBDATE");
    Date sdate =set.getDate ("EBSTARTDATE");
    Date edate =set.getDate ("EBENDDATE");
    int kw =set.getInt ("EBKILOWATT");
    int maxdemand =set.getInt ("EBMAXIMUMDEMAND");
    int days =set.getInt ("EBDAYS");
    %>
    <tr>
    <td width="211"><div align="left"><b>Bill Date :</b></div></td>
    <td width="573"><%=sdfOutput.format(date1)%></td>
    </tr>
    <tr>
    <td width="211"><div align="left"><b>Bill From :</b></div></td>
    <td width="573"> <input type="text" name="textfield" value="<%=sdate%>"></td>
    </tr>
    <tr>
    <td width="211"><div align="left"><b>Bill To :</b></div></td>
    <td width="573"> <input type="text" name="textfield2" value="<%=edate%>"></td>
    </tr>
    <tr>
    <td width="211"><div align="left"><b><b>kiloWatt Use (Rm)</b>: </b></div></td>
    <td width="573"> <input type="text" name="textfield2" value="<%=kw%>"></td>
    </tr>
    <tr>
    <td width="211"><div align="left"><b>Max Demand kiloWatt (Rm):</b></div></td>
    <td width="573"> <input type="text" name="textfield2" value="<%=maxdemand%>"></td>
    </tr>
    <tr>
    <td width="211"><div align="left"><b>Days In Billing :</b></div></td>
    <td width="573"> <input type="text" name="textfield2" value="<%=days%>"></td>
    </tr>
    <%
    %>
    i hope. Now u wouldn't get any error message...but...u wouldn't get results as well...Check ur date format with access date format....
    Revert back

  • Delete and attach library without forms builder using java api

    Hi all,
    I am not at all familiar with JAVA. Appreciate if somebody can help me out.
    We have a lot of forms and we are moving them to aix server. To standardize we have renamed all the files as FILENAME.ext i.e filename is upper case and extension is lower. After doing this we get errors while compiling the fmbs as the filename has been modified after it was attached in the forms.
    I need the java api and the procedure to run the api to delete the existing attached libraries and attach the renamed libraries.
    Appreciate your help in this regards.
    Regards,

    hello,
    There are severail ways for you to solve this problem.
    1) Use the jdapi utility you can find at Francois degrelle's javabean depot. Quite easy to use and should solve your problem. You can find it here:
    http://forms.pjc.bean.over-blog.com/article-13596554.html
    2) Use the following two java methods as the basis for your java converter.
    <blockquote>
    private boolean findJdapiObject(JdapiObject object,String objName){
         boolean matchFlag=false;
         // get Iterator with all ownedObjects
    JdapiIterator ownedObjects = object.getOwnedObjects();
    // loop all ownedObjects
    while (ownedObjects.hasNext()) {
    JdapiObject ownedObject = (JdapiObject)ownedObjects.next();
    if (ownedObject.getName().equalsIgnoreCase(objName)){
         matchFlag=true;
         message_verbose = "Librairie PLL est déjà attachée !! " ;
    this.addOutputLine(message_verbose,0);
         return matchFlag;
    // check child objects of this child using recursion
    findJdapiObject(ownedObject, objName);
    return matchFlag;
    private void addJdapiObject(JdapiModule object,String objName){
         boolean matchFlag=false;
         //check if PLL exists
         matchFlag=findJdapiObject((JdapiObject)object, objName);
         if (!matchFlag){
              //add PLL
              numOcc++;
              AttachedLibrary newLib =
    new AttachedLibrary((FormModule)object,objName.toLowerCase());
    </blockquote>
    You need to check that your object does not exist before adding it. You can also modify the addJdapiObject method to remove objects.
    Hafed

  • Upload a logo in the form builder

    Hi All,
      Could anybody tell me how to upload a logo in the form builder using tcode either pe50 or pe51.
    Regards,
    Srinivas.

    Hi Srinivas,
    You have to for a pre-printed stationary for the logo.
    I mean use the stationary which has logo already printed & then use form editor to print the data.
    For what purpose your using form editor?
    If your using for Payslip/Renumeration statement, then this is the only way. I had done the same thing, used pre-printed statinary containing logo on it.
    Hope this helps.
    Thanks,
    Sarika.

  • FRM-10095 in Oracle Forms Builder Forms [32 Bit] Version 9.0.2.9.0

    Hello,
    I got the error message (in German) "FRM-10095 Ausführung in iewbdc_oracle_to_id, um E:\f021w32\src\ie\iewbdb.c:715 fehlgeschlagen". I got this error, when I tried to create a forms block using the data block wizzard on the Oracle-OE-table "orders". I think the problem is, that in this table is a column with the data type "timestamp(6) with local time zone". Other tables without this datatypes work. Is the only solution to change the data type of this column or is there another solution?
    Thank you
    Ralf Nobes

    Hi Sarah,
    my reports-server works all the time, and i did not do any configuration or install any loopback-adapter. I have a reports-server name like rep_<machine> and can use that in forms also as in URL-syntax.

  • Problem with NLS_CALENDAR=PERSIAN with Form Builder 6i

    Dear All,
    I have some problem with the Persian calendar which is known for oracle. I have set NLS_CALENDAR=Persian in DB (10g) and Registry of Form Builder. Some days at the calendar when convert from Gregorian to Persian will be decrease (1 day ) for example 13870112 convert to 13870111 ( 1387 It is a leap year and begins from 20-MAR-2008) or some days will be increase for example 13861222 convert to 13861223.
    These days are correct in SQL*PLUS but are incorrect in Form Builder.
    Moreover, some days are shown like ########## in form builder.
    13870101--------> #########
    13860101--------> #########
    And at the end, when I insert a new record from Form Builder the actual date is 1 day greater in DB.
    Please Help me to find out how can I solve this problem.
    Regards,
    Iman

    Hello Faust,
    have already tried that in SQLPlus, SQLWorksheet, MS Access (OffXP). All apps used on the same computer. OS Win XP Prof.
    Result in Plus and Worksheet
    40 ! â a a î l c ç i Ä . < ( + ! 50 ! & e e e i n k g Ü $ * ) ; ^ 60 ! - /  A A Î L C Ç I ö , % > ? 70 ! E E E I N K G ` : § ' = " 80 ! a b c d e f g h i [ ] g @ 90 ! ° j k l m n o p q r º ¿ A0 ! µ ß s t u v w x y z G ¿ B0 ! 0 1 2 3 4 5 6 7 8 9 a ß ¿ d e ¿ C0 ! ä A B C D E F G H I š &#65533; t õ D0 ! ü J K L M N O P Q R · u i s u E0 ! Ö S T U V W X Y Z ² Š &#65533; T Õ F0 ! 0 1 2 3 4 5 6 7 8 9 ³ U I S U
    result in Access (via ODBC Con)
    40 ! â &#261; &#257; î &#316; &#269; ç &#299; Ä . < ( + ! 50 ! & &#275; &#281; &#279; &#303; &#326; &#311; &#291; Ü $ * ) ; ^ 60 ! - /  &#260; &#256; Î &#315; &#268; Ç &#298; ö , % > ? 70 ! &#274; &#280; &#278; &#302; &#325; &#310; &#290; ` : § ' = " 80 ! a b c d e f g h i [ ] &#287; @ 90 ! ° j k l m n o p q r º &#8793; A0 ! µ ß s t u v w x y z &#286; &#916; B0 ! &#8320; &#8321; &#8322; &#8323; &#8324; &#8325; &#8326; &#8327; &#8328; &#8329; &#945; &#946; &#947; &#948; &#949; &#969; C0 ! ä A B C D E F G H I š ž &#355; õ D0 ! ü J K L M N O P Q R · &#371; &#305; &#351; &#363; E0 ! Ö S T U V W X Y Z ² Š Ž &#354; Õ F0 ! 0 1 2 3 4 5 6 7 8 9 ³ &#370; &#304; &#350; &#362;

  • Form Builder connecting to Oracle database

    I recently dowloaded the Personal Edition of the Oracle 10g database.
    Having done that, I installed a copy of Oracle Forms 6i which I had.
    When I used to connect to the database from the Forms Builder, I only entered username "scott" and password "tiger".
    Now, it seems I also need to enter the database name to connect.
    I tried "Oracle10g", which I think is the instance name, but I get an error about not being able to "resolve service name."
    Can someone help me with this?
    Thank you.

    Although not related to your problem, connecting Forms 6i to a 10g database isn't really a good idea. Although it is supported by Oracle, you are likely to have problems. Remember that Forms/Reports 6i is very old (and no longer supported) and was based on the Oracle 8.0.6 architecture. Additionally, be sure you are using Forms 6.0.8.22 (Patch 13) or newer if you plan to connect to 10.x.
    That said, your problem is not related to the versions you are using. It is caused by the fact that the database is considered "remote" relative to Forms. This is true even though both products are likely installed on the same machine. By having them installed in different Oracle Homes (which you must), the database might as well be on another machine.
    Short answer, you need to add the database information to the tnsnames.ora file found in the Forms Oracle Home. More specifically, it can be found in:
    %ORACLE_HOME%\NET80\ADMIN
    The other alternative is to set TNS_ADMIN in the system environment (not the Windows Registry). This will point to the database's tnsnames.ora and will allow all installed products to access the same file.

  • Oracle Forms Builder - CLIENT_HOST

    I have a visual basic script, which I want to call it from forms with client_host method.
    But I need to pass a value and a value pick. Is this possible?, If not, what options I can have?.
    I tried using CLIENT_OLE2, but I have trouble calling LibreOffice, making it an option ruled out.
    Thanks.
    Jose.

    Thanks for your answer .
    Currently I have a program made in Oracle forms builder with a data entry screen , this screen has some fields in validate -item call the spell checker in MS -Word . I need to change MS -Word for LibreOffice , but with CLIENT_OLE2 Seller WebUtil is not implemented to call LibreOffice .
    One option I thought of that is through a visual basic script as a parameter to pass the word to be corrected and that the vbs me back the list of alternative words (that I see it very difficult for the subject to pass input and output parameters ) .
    The other option you now I'm investigating is to make a java class (although I have not much knowledge in Java ) , import java class to the forms and make the call to the class method . As far as I arrived was to make a simple test for a method that adds two values and it has worked . Now I need to see what I call the LibreOffice spellchecker .
    The application runs under Windows , the database is Oracle 10g and forms version is 10.1.2.0.2 .
    Again, thank you very much for your answer.
    Jose.
    PD: I apologize for my English.

  • Opening forms builder 11g in linux

    i installed 11g in a linux computer. I can easily use frmplsqlconv.sh to convert my old forms and frmcmp.sh to compile but if i try to open forms builder i get an error: "FRM-91129: fatal error: no value specified for required environment variable FORMS_BUILDER_CLASSPATH".
    What do i have to do?

    I'm Working with redhat Linux 5.0. and oracle 11g database and oracle 11g forms.We could open form builder easily but today it shows error saying "forms builder is only supported on x86..."
    Can anyone help me please.

  • How to see the packaged procedures in form builder?

    Hi Experts,
    I have a oarcle apps form in form builder.
    When i want to see the code behind the trigger when pressed button do ,i see that it calls a packaged procedure like
    oksaudet_header.when_button_pressed(p_item => 'STOP_BUTTON');
    I want to see beyond this ,so how to find out this package procedure oksaudet_header.when_button_pressed?
    if its any pll ,how do i know which pll will have this package?
    Thanks

    Hi,
    You just need to search for component OKSAUDET_HEADER in Forms Builder (use the 'Find' button). It will take you to the package, and above it you will find the attached library that contains it (if it's an attached library).
    Hope it helps.

  • How to connect Oracle Form Builder - Oracle Developer Suite 10g - Windows 7

    Hi brothers and sisters,
    Hope all you are fine. I have installed Oracle Developer Suite 10g on Windows 7 successfully and it is working properly. But when I connect to Oracle Form Builder using Connect window asking:
    a. User Name
    b. Password
    c. Database
    a message box appear: 'ORA-12154: TNS:could not resolve the connect identifier specified'
    I verify my Connect String with: 'SELECT * FROM v$database', but the problem remain the same.
    Please help me how can I connect to Oracle Form Builder.
    Noor

    hi
    plz use Net Configuration Assistant or set tnsnames.ora with connect string and computer name.
    Net Configuration Assistant.
    when its opened then go to .
    *Local Net Service Name Configuration.
    *Click Next.
    *Add.
    *Click Next.
    * Service Name--Type here connect String which is XE or any Connect String.
    *TCP.
    *Click Next.
    *Host Name--Enter here Computer name or Ip address.
    *Yes,Perform a test.
    you can enter correct password and username here.
    Note:- your Database should be Up if its not Up it will through the same error so plz startup your database first.
    sarah

  • Forms Builder default font?

    Is there anyway to set the default font that Forms Builder uses when creating text items?
    Normally when I start developing a new form Forms Builder defaults the font to Microsoft Sans Serif 8, but for some reason everytime I open Forms Builder now I get a font of Tahoma 8 and I'd like to change it to something else.

    Java fonts are different and limited, so even you set your fonts different on windows, at runtime you will be limited to the java supported fonts. I usually set it to helvetica and it seems pretty close to what I see at runtime. But , we are developing and deploying on Linux, so it may be different on windows.

Maybe you are looking for

  • Error handling for RGB values

    Hi I am having problems doing error handling for RGB values. I have a Java applet with 3 JTextFields whose values are parsed as int variables and stored as ints. If a value is entered that is not a value between 0 and 255 is entered, the appropriate

  • Table name for the desc for marine pollutant HISubsMP in dangerous goods

    Hi All, I want the table name where the description of the marine pollutant gets stored in hazrd inducer substance. HISubsMP   CUST-100000000000262    (CONTAINS MARINE POLLUTANT) I want to fetch the 3rd descrition. in which table it is stored.? Thank

  • Fix for Error (-9838)

    Some one called apple support and this is what they told him. "DO NOT disconnect your phone. Intead, when you get the message saying it timed out, click ok. Then click on any other heading, Music for example, in your itunes. Then go back and click on

  • EJBQL IN or not IN?

    I'm trying to develop an EJBQL query, and I can't seem to express what I want - there may be a way, please let me know what you think. The schema: I have a table called 'Vouchers', and a table called 'Courses'. There is a many-to-many relationship be

  • WIreless keyboard shift key problem

    I have an Apple wireless keyboard which was working fine for the past 10 months, until this morning. Now, when I press the shift key, it types an "I" and whatever other key I hit. Also, there are occasional random capital letters when I type without