given number of working days for the current month to date

Hello

How can I get the number of days of data using SQL date? appreciate for your help. Thank you.

Hello

Whenever you have a problem, please report all that is necessary for people to recreate the problem and test their ideas.  In this case, including CREATE TABLE and instructions INSERT for all necessary tables (just a few lines, only relevant columns) and the results you want from this data.

The syntax of a scalar subquery (that is, a query that takes the place of a single value, as in a CASE expression) is

(

SELECT...

Of...

)

in other words, all of the query must be within parentheses surrounding nothing else.  It seems that you have the SELECT keyword in a CASE expression without a parenthesis opening right before she left.

Tags: Database

Similar Questions

  • 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

  • Filter a report to take the date of closing days for the current month

    Hello.

    I need to create a filter on to only opportunities extraction that are expected to close for the month that we are in a report. By that I don't want to not just Augustus, but regardless of the current month is that the report is run

    The date 'Should close' is a timestamp field in our OnDemand.

    Thank you!

    Hi, you can create a SQL filter as below

    YEAR ("Closing Date". Date) = VALUEOF (NQ_SESSION. CURRENT_YEAR) AND MONTH (the "Closing Date". Date) = VALUEOF (NQ_SESSION. CURRENT_MONTH)

    Hope this works

    -John CRMIT

  • How to copy the data for the current month for future months based on the current month

    Hello

    If the current month is Jan they copy data Jan rest months this year there. If the current month's data copy Feb Mar Feb, Apr, dec... and so on... The following script can achieve this goal, but it increases the number of lines of code... Please y at - it another way that we could achieve this functionality.

    Difficulty (year1, entity1)

    "account1" (if (& Currentmonth == "Jan"))

    "account1"-> "Feb" = "account1"->"Jan";

    "account1"-> "Mar" = "account1"->"Jan";

    ------

    ---

    "account1"-> "Dec" = "account1"->"Jan";

    ElseIf (& ifcurrentmonth == 'Feb')

    "account1"-> "Mar" = "account1"->"Feb";

    --

    "account1"-> "Dec" = "account1"->"Feb";

    endif ;);

    endfix;

    Thank you

    Praveen

    Hi Praveen,

    You can write a script as shown below

    Fix(Year,Entity,&Currentmonth:DEC)

    Account1 = account1-> & Currentmonth;

    endfix

    This will make.

    Concerning

    Anubhav

  • Return of records only for the current month

    Hello

    I have a query that returns records for the current week and I want to extend it for return records for the current month.

    When TRUNC (start_date) < NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, "Sat") + 1
    AND TRUNC (end_date) > NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, 'Sam')-7

    I have two date fields, the first is called 'Start_Date', the second is called 'End_Date '. I want the query to return all the records for the current month including those who may start before or end post the month as events can start in a month and end with another. Does anyone know how this is done in a "Clause where?



    Kind regards

    Steve Welch

    You probably want to

    where TRUNC (START_DATE) <= LAST_DAY(TRUNC(sysdate, 'MONTH'))
    AND TRUNC (END_DATE) >= TRUNC(sysdate, 'MONTH')
    
  • Return of the records for the current month, previous and next

    Hello.

    Robert Charlton contributed to my last question on this topic and thank him once more for this.

    When you filter the results of the report by using the following database returns records for the current week:


    WHERE 'SS_LEAVE '. "" LEAVE_TYPE "="SS_LEAVE_TYPE. " "" IDENTITY CARD ".

    AND)
    InStr (superior ("EMPLOYEE"), upper (nvl (: P2001_SEARCH, 'EMPLOYEE'))) > 0 or
    InStr (upper ("SUPERVISOR"), upper (nvl (: P2001_SEARCH, 'SUPERVISOR'))) > 0
    )
    AND TRUNC (end_date) < NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, 'Sam') + 1
    AND TRUNC (end_date) > NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, "Sat")-7


    My question is this time is:

    How to make a filter for the current month, the 'previous month', and 'next month '?


    Kind regards

    Steve Welch

    Steve,

    Current month:

    and trunc(end_date) >= trunc(current_timestamp,'MM') and trunc(end_date) < add_months(trunc(current_timestamp,'MM'),1)
    

    Previous month:

    and trunc(end_date) >= add_months(trunc(current_timestamp,'MM'),-1) and trunc(end_date) < trunc(current_timestamp,'MM')
    

    Next month:

    and trunc(end_date) >= add_months(trunc(current_timestamp,'MM'),1) and trunc(end_date) < add_months(trunc(current_timestamp,'MM'),2)
    

    -David

  • Studio EN - is there a work around for the problem of referencing data from a grid with a different connection of DB and # different dimensions?

    Hello

    I'm making reference to a column in a different grid with a different database connection. I did some searching in the forums, and it seems that it is a known problem with EN Studio. The problem is that if 2 different database connections have different number of dimensions, then the reference will throw an error.

    For example, what I try to do, is below:

    In grid2.column [A], I have the following formula:

    Grid1. Column [A]

    The result is an error.

    The ultimate goal is to have a base of variance formula in the grid between grid1 and grid2, who have connections to different database with a different number of dimensions. Is there a solution to this bug? The example of the basic formula is less to:

    Grid1. Column [A] - grid2.column [A]

    Any help is very appreciated!

    Thank you

    Tiffany

    Have you tried to change the database connection in a row instead of create a new grid?

  • turnover of 18 weeks from the week of the current month number

    Hello

    I have a requirement as described below.

    Time table name:
    Columns: year, month of exercise and exercise week

    table above has the join with the sales table and contains data on sales according to the week. so less granularity of data at the level of the week.

    We have a report that contains columns exercise, actual sales and forcast sales. our requirement is to filter the data with the following criteria.

    Filter for the current month
    Fiscal week Jan between 1-18 of the current year
    Fiscal week Feb between 5-23 of the current year
    Week fiscal March between 9-27 to the current year

    .
    .
    .
    .
    Fiscal week November between 44 the week of the current year and week 10 of next year

    December

    with above requirement therefore filter the data bearing 18 weeks from the week of the current month number


    I tried with timestampadd (interval, sql_tsi_week, week), but it does not work as I expacting. Please provide the code/logic to do so.

    Appreciate your help.

    Thank you
    Jay.

    Jay wrote:
    I need to get the results of 18 weeks of turning to anypoint starting with the week number of the 1st of every month at 18 weeks. read my question again once and you will be able to understand.

    It kind you of lack the point to be honest. It is very difficult to answer specific questions without the required information. To answer a question like this we need a minimum of:

    1. oracle version
    2. examples of data (CREATE TABLE / INSERT statements)
    3. expected results
    4. explanation of the business rules.

    Alternatively, you can read the link in my original reply.

    Please provide the information requested and someone can help.

  • How to make a sum of working capital for a 12 month calendar look back?

    I have a table with dates and values for each date. I would like to create a total working capital which looks backward from today and give me a total for the past 12/24 months. Is there a feature that will allow me to do this? Thank you!

    Hello

    You could do something like that.

    Version A: = SUMIFS (B, $A, "> =" & EOMONTH(A1,0) (TODAY (), −12) will GET)

    Version b: = SUMIFS (B, $A, "> =" & EOMONTH(A1,0) will GET (TODAY (), 13))

    Version C: = SUMIFS (B, $A, "> =" & EOMONTH(A1,0) will GET (today (), 13) ', ')<>

    A version assumes that you do not want to include values for the current month (part-time).

    Version B "was one more month" so you include the current month.

    Version C would be appropriate if you have future dates in your column too and must exclude those.

    To come back two years you would have-24 or - 25 in formulas.

    More on today, SUMIFS and EOMONTH(A1,0) will GET here, here and here.

    My 39:41 lines are defined as lines of footer to make it easy to enter formulas.  Formulas, of course, could be in a separate table.

    SG

  • date of the current month

    for a date column, I have data for a year

    Suppose I run the query on the month of August, I want to retrieve date during the month of August
    means I want to retrieve the data for the current month.

    This will still take the start date of the current month to the last day of the current month.

    WHERE col  BETWEEN  TRUNC(SYSDATE,'MM') AND LAST_DAY(SYSDATE) 
    
    OR
    
    WHERE col  BETWEEN  TRUNC(SYSDATE,'MM') AND TRUNC(ADD_MONTHS(SYSDATE,1),'MM')-1
    
  • You want to display the current month and previous month data in a single record on forms?

    Hello experts,

    I have this requirement:

    Table structure:

    Division of months value totalAmount

    01-apr-2013 1 10000

    May 1, 2013 1 20000

    01-apr-2013 2 30000

    May 1, 2013 2 50000

    I want to display in forms such as

    Form:

    Month: May 1, 2013

    Total difference of month Division total division prev_Month

    May 1, 2013 1 10000 April 1, 2013 1 20000 10000

    May 1, 2013 2 30000 April 1, 2013 2 50000 20000

    I use two procedure to fetch the records for the current month and the previous month.

    but it will cause a problem, if for some data division previous month do not arise.

    Please suggest me some query I can get with current and data month pre to unique record.

    Please help me.

    Thank you

    Yoann

    I DON'T KNOW BUT TRY...

    Select the month of x.mn, x.division, total x.totalAmount, y.mn prev_month, y.division, total y.totalAmount, (y.totalAmount - y.totalAmount) difference

    Of

    (select month mn, division, totalAmount value)

    from table_name

    where month = (select max (month)

    from table_name

    )

    ) x,.

    (select month mn, division, totalAmount value)

    from table_name

    where month = (select add_months (max (month),-1))

    from table_name

    )

    ) y

    where x.division = y.division

    /

    ALEXANDER SIMONNET

    DHAKA BANGLADESH

  • How do I know the current month

    Hi Everibody,

    I need to know if there is a function o something in Hyperion to calculate the current month.

    Thank you!!!

    Edited by: Dieguinho on 22/07/2010 13:36

    you mean current month is the current month?
    Then, we can automate the input of the variable current month using the batch program by choosing the date system.
    You can use the variable to calculate the data for the current month.

  • Procedure for the number of working days per month when the user enters to and from everyday

    Hi all

    Can provide you a solution to this - procedure for the number of working days per month when the user enters and days.

    Suppose that the user enters November 18, 2014 start date and date as November 23, 2014.

    The output should display

    Count: 4

    November 18, 2014 Mar

    Sea 19 November 2014

    November 20, 2014 game

    Fri November 21, 2014

    It will exclude Saturday and Sunday.

    Hello

    Here is an example of removing dates Saturday and Sunday:

    with days as(
         select (trunc(sysdate, 'YEAR') + level) as col from dual
         connect by level < 365
    )
    select * from days
    where trim(to_char(col, 'DAY', 'NLS_DATE_LANGUAGE=ENGLISH')) not in ('SATURDAY', 'SUNDAY')
          and col between to_date('18.11.2014', 'DD.MM.YYYY') and to_date('30.11.2014', 'DD.MM.YYYY')
    order by col;
    

    Cheerz,

    Stako

  • in the cloud? Number of working days derive from timestamp

    Y at - it a connector or an app that can take a DATE (for example 01/10/2012) and calculate the number of working days?

    No, the date calculator is only calendar days, not working days (should be enough culturally fancy that geo had what holiday...).

    The easy solution (but hacky) is to the calendar days * 5/7, bringing the working days... not elegant, but it converges on ~ accurate with many...

  • I'm looking for the 1st working day of the week.

    Hello

    I'm looking for the 1st working day of the week except Saturday, Sunday and holidays. I have vacation, the name of the table that contains the columns HolidayDate and HolidayDescription.

    Ex:

    01/10/2011 is monday (i.e) 1st company day.check if it is in the host table, then return the result as 01/11/2011 other returns the output as a 11-1-2011(which is the first business day of this week).


    Can someone tell me the query to solve?

    Hello

    If dt is any DATE, it is the first day of work in the same week as dt:

    WITH     all_week     AS
    (
         SELECT     TRUNC (dt, 'IW') + LEVEL - 1     AS a_dt
         FROM     dual
         CONNECT BY     LEVEL <= 5
    )
    SELECT     MIN (a_dt)     AS first_work_dt
    FROM     all_week
    WHERE     a_dt     NOT IN (
                      SELECT  holiday_dt
                      FROM    holiday
                     )
    ;
    

    This assumes that you have never 5 consecutive days. (Where I work, holidays are always at least a week apart, so that's fine.)
    If you have a week's holiday, increase the number of 'magical' in the CONNECT BY clause.

    It also means that holiday.holiday_dt = TRUNC (holiday.holiday.dt).

Maybe you are looking for