to get the previous date

to_char(AHB.trh_BICARA,'dd') dat1,
to_char(AHB.trh_BICARA,'yyyy') year1,
DECODE (TO_CHAR (AHB.trh_BICARA, 'DY'),
'SUN','AHAD',
'MON','ISNIN',
'TUE','SELASA',
'WED','RABU',
'THU','KHAMIS',
'FRI','JUMAAT',
'SAT','SABTU'
) day,
DECODE (TO_CHAR (AHB.trh_BICARA, 'MM'),
'01', 'JANUARI',
'02', 'FEBRUARI',
'03', 'MAC',
'04', 'APRIL',
'05', 'MEI',
'06', 'JUN',
'07', 'JULAI',
'08', 'OGOS',
'09', 'SEPTEMBER',
'10', 'OKTOBER',
'11', 'NOVEMBER',
'12', 'DISEMBER'
) month1
the higher the code for the date, I need the previous day. How to write the query to do this

Hello

I'm not sure that understand the question.

If AHB.trh_BICARA is a DATE, then

AHB.trh_BICARA - 1

is the DATE exactly 24 hours earlier.
So, if

DECODE ( TO_CHAR (AHB.trh_BICARA, 'DY'),
     'SUN',     'AHAD',
     'MON',     'ISNIN',
     'TUE',     'SELASA',
     'WED',     'RABU',
     'THU',     'KHAMIS',
     'FRI',     'JUMAAT',
     'SAT',     'SABTU'
       )

Returns "AHAD", then

DECODE ( TO_CHAR (AHB.trh_BICARA - 1, 'DY'),
     'SUN',     'AHAD',
     'MON',     'ISNIN',
     'TUE',     'SELASA',
     'WED',     'RABU',
     'THU',     'KHAMIS',
     'FRI',     'JUMAAT',
     'SAT',     'SABTU'
       )

will return 'DUBOIS '.

Tags: Database

Similar Questions

  • cannot restore from the previous date says computer is unprotected I just get rid of the virus of audit system

    rid of virus check system but cannot restore the computer to the previous date

    You never said how you got rid of the "System Check" malware. As far as we know, he is still there. Follow these instructions (if you have not already done so):

    Also, as Jose pointed out, there are programs that are designed to interfere with the system restore (Norton is one of the most common). But there are really two questions. First of all, we will treat your malware problem. We can always revisit SR at a later date.
    Finally, even once as Jose pointed out, you NEVER run the system restore after the removal of the malware! Which could only bring him back! That you have to turn it off and then put it again, which will REMOVE all previous restore points. You really all gone!
  • Get the latest data of Variable shared before disconnecting from the network

    Hello.

    I use Shared - published network variables for my communication between two PC's. Each LV software will pass the data to another.

    Sometimes the wireless connection to become really bad and the network connection stops.

    I want to get the latest data. Currently my VI will show the value '0' on the variable shared data once the connection is cut.

    I tried using shift, but she registers the same results.

    Can someone show me how I can stay past data when the network connection is disconnected.

    Thank you very much.

    Kind regards

    Hello Fan, Ravens

    It works! Thank you very much.

    Kind regards

  • Get the raw data to map its (SDK)

    I did a search on sound cards and many forums have been useful.  I have just a few quick questions.

    I have a card his (CardDeluxe http://www.digitalaudio.com/) connected to the computer through a PCI.  My goal is to get the raw data from the card and plug and it blow in analytics in CVI.  I don't know how to "talk" to my sound card.

    Of course, my main question is above, but to the refine some concerns...

    I guess I need the SDK libraries for that.  For this, I just need to install the MSN help libraries?

    Is this possible in the Basic Version, or if the full Package of CVI is necessary?

    I have not done things well at low altitude, but it looks like getting a wav file is necessary.  I can't use anything outside of the applications I want to eventually create a program automatically record and play at a time (sync) précis.

    Thanks in advance.

    This site is what I was looking for.  The zip file contains an exe as file c source code.

    http://paulhoule.com/phsrec/index.php

    Edit:

    There is also some info here - http://forums.ni.com/t5/LabWindows-CVI/wav/m-p/235344

  • problem to get the current date in qml

    Hello world

    I'm trying to get the current date in c ++ and qml and I used the class QDate, but it still has some problems:

    Code:

    =====================================================

    QDate * nowdate = new QDate;
    QDeclarativePropertyMap * nowdateMap = new QDeclarativePropertyMap;
    nowdateMap-> insert ("date", QVariant (nowdate-> currentDate()));
    QML-> setContextProperty ("nowdateMap", nowdateMap);

    ===========================================================

    After setting the nowdateMap, I'm able to get the date in the application, but the format is really weird, I did not use QDatetime, but the restult of shows like ' 2013-1 - 3 T 00: 00:00 ", how can I get rid of the final"T00:00:00 "? or is there a better way to get the current date?

    Thank you

    QDate nowdate is QDate::currentDate();.

    QString nowdatestring = nowdate.toString (); / / to get the date string format, you can define the shape of toString(), you can //search it
    QDeclarativePropertyMap * nowdateMap = new QDeclarativePropertyMap;
    nowdateMap-> insert ("date", QVariant (QString (nowdatestring)));
    QML-> setContextProperty ("nowdateMap", nowdateMap);

    then in the file qml, using nowdateMap.date will do.

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • request to get the next date which is not a public holiday

    Hello world

    I need help for a query.  consider the following data

    holiday

    -------------

    SELECT To_Date('12/28/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('12/25/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('08/31/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('05/25/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('05/04/2015','mm/dd/yyyy') double holiday

    curr_DATE

    -----------

    SELECT To_Date('12/25/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('12/24/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('12/23/2015','mm/dd/yyyy') double holiday

    data of curr_date are the main table.  given a date, I want to join the vacation and the date of the Curr so that the result will be a date that is not a holiday.  for example, what gives 28 Dec.  the next available in curr_date < 28 dec date is dec 25. However, dec25th is a holiday on the guest table if the output should be dec 24.

    Another example is the following: given dec 25 date, the previous date, unless that Dec. 25 is dec 24th dec 24 is not in the host table output should therefore be dec 24.

    Another example: I'll add another line to the curr_date table. If the data will look like this

    curr_DATE

    -----------

    SELECT To_Date('12/28/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('12/25/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('12/24/2015','mm/dd/yyyy') double holiday

    UNION ALL

    SELECT To_Date('12/23/2015','mm/dd/yyyy') double holiday

    given dec 29, the next available in curr_date date is less than 29 dec 28 dec. However, dec28th is holiday in the host table. the next available date is dec 25 in curr_date, but once again dec25 in the host table.  the next available date is 24, but this date is not in the host table output should therefore be 24/12/2015.

    So basically I want to do this in the query by joining the two tables.  can anyone help? pl/sql is ok if it cannot be done using quries.

    Hello

    If you want to use a join, here's one way:

    SELECT MAX (c.holiday) AS last_non_holiday

    OF curr_date c

    LEFT OUTER JOIN holiday h ON h.holiday = c.holiday

    WHERE c.holiday< to_date="" (:cutoff_date,="">

    AND h.holiday IS NULL

    ;

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows?

    I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows so that I can do the calculations?

    If you start the https://forums.adobe.com/welcome Forums Index

    You will be able to select a forum for the specific Adobe products you use

    Click on the symbol "arrow down" on the right (where it is said to see all our products and Services) to open the drop-down list and scroll

  • How to get the current date to display in the Spanish format.

    The coding is in format Adobe Acrobat, DC. The coding I have for the English today's date is:

    var d = new Date();

    sDate = util.printd var ("dd mmmm yyyy", d);

    this.getField("Text1").value = sDate;

    How can I get the current date displayed in this Spanish format: 07 December 2015

    Thank you

    It's a little complicated... But this code should do the trick:

    util.printd("dd", d) + " de " + util.printd("date(es){MMMM}", d, true) + " de " + util.printd("yyyy", d);
    

    Edit: Fixed the code... Did not notice the 'of' second before.

  • How to get the old data 6 months from the current date?

    Hi friends,

    I have a table which includes historical data, which are having more than 1 years old data. The historical table gets updated once a week. My requirement is that I should get the latest data from the week of each month for 6 months according to the current data. I use oracle 10g.

    Can you please someone help in this.

    Thanks in advance

    SELECT last_day (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL))-7 start_dt.
    LAST_DAY (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL)) end_dt
    OF THE DOUBLE
    CONNECT BY LEVEL<=>

    change as a result, I have provided you the start and end dates for your logic...

  • How can I get the previous version of Muse?

    HTML & Javascript in an HTML embeded object does not work properly since I downloaded the latest update (November 2013). How/where can I get the previous version of Muse?

    I understand the problem. My code was beautiful, but a feature in 'on' by default in the update of November 2013 Muse has created the problem.

    The thumbnails on my homepage are PNG files. They are there by registering directly (via the button placed under the file menu). However, on my subpages, the thumbnails are referenced via Javascript in an HTML object. Like the placement of the tiles according to the results of the homepage of them being available in the generated Muse 'image' file when the site is exported, I can refer to them later Javascript in an HTML object in the pages following (I do this to show some random images). However, the files that I placed on my homepage are PNG and Muse was exporting as JPG because of a feature (in file / properties of the Site) is checked by default in Version 7. The feature is "opaque PNG convert to JPEG". Once I unchecked that defining and re-exported my site referenced by my Javascript PNG thumbnails appear on the subpages.

    P.S. A couple of hours on the merry Road round to find the question - Ouch!

  • Error "could not get the audio data in the file.

    Hello

    I get a lot of mistakes "Could not get the audio data in the file" when you open a project. Sometimes they will plant Premiere Pro CC 7.01 (Mac). But if no first works as usual, with the audio.

    I tried to convert the audio files (from the hearing) from 32 to 16 bit. It worked while opening a project once, but not the next time.

    Where can it be?

    Edit: I also get this error when importing audio: "error: Premiere Pro version 7.0 is not compatible with the first version of plugin Pro 5.7.4. Maybe it's related.

    I have it! This is the plugin Smartsound hurt. Got rid of him and no more errors.

  • get the current date for condition satisfied

    Hello world

    I want to get the current date for the following query.

    SELECT B.NAME, C.FST_NAME, C WHERE S_CONTACT, S_ORG_EXT B, C.LAST_NAME OF S_PARTY_PER A (B.ROW_ID = A.PARTY_ID AND C.ROW_ID = A.PERSON_ID AND A.PERSON_ID IN (select D.NEW_VAL from the S_AUDIT_ITEM where D.OPERATION_CD = 'Associate' and OPERATION_DT = 'I want the current date from 07/10/2008 12:00:00 AM to 07/10/2008 23:55:55 '))

    Help, please...

    Hello

    Like this?

    SELECT B.NAME, C.FST_NAME, C.LAST_NAME
      FROM S_PARTY_PER A, S_ORG_EXT B, S_CONTACT C
     WHERE (B.ROW_ID = A.PARTY_ID AND C.ROW_ID = A.PERSON_ID AND
           A.PERSON_ID IN
           (select D.NEW_VAL
               from S_AUDIT_ITEM D
              where D.OPERATION_CD = 'Associate'
                and trunc(OPERATION_DT) = trunc(sysdate)
    --                'i want current date start from 10/7/2008 12:00:00 AM to 10/7/2008 11:55:55 PM'))
    
  • How can I get the filtered data from the first form

    How can I get the filtered data from the first form in a second form to make an update of the multi.
    Thank you very much

    William,

    I would use for this collections. A link is good if you need to pass a single value.

    1. create a collection
    2 fill the collection with your result set
    3. go in the page target and uses a method of a query in your link to this page
    4. your target page receives a request and allows you to edit documents.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

Maybe you are looking for