Date between Query

how to write a date query between two dates

or
  select *
    from emp
   where trunc(hiredate) >= trunc(from_date)
     and trunc(hiredate) <= trunc(to_date)

Similar Messages

  • Date BETWEEN query with a difference?

    Hi,
    I have a BETWEEN query (at least I think that's what it will need), but with a difference.
    Normally you would specific a field which was BETWEEN two set variables
    ie. {fieldname} BETWEEN 1 AND 3
    However I need mine the other way round.
    I have a series of records which have a startdate and enddate held against them.
    When a user submits a new record to the db, I need it to check that the starting and ending date range doesn't overlap any of the existing start-end date ranges that exist.
    In order to do that I'm trying to build a query which takes in the incoming startdate variable and see if that is within any of the existing start-date-enddate dates ranges of the existing records, and then same for the incoming endate. I actually want the ones that are going to cause a problem to appear...
    I;m sure there is a pretty easy way of coding this, but I'm struggling to get my head round it.
     Anyone offer any advice?

    You can try something like this
    use adventureworks
    go
    select birthdate from humanresources.employeetest where birthdate between
    (select min(birthdate) from humanresources.employee) and
    (select max(birthdate) from humanresources.employee)

  • Dates Between Query :( with out TO_DATE.

    Greetings,
    I have a query whete in the where clause I compare a column b/w two dates. The Query looks like this,
    trunc(LAST_UPDATE_DATE) BETWEEN '22-FEB-03' AND '21-MAR-03'.
    This query doesn't fetch any records. Whereas when I use the query with a TO_DATE function it works fine. The query looks like,
    TRUNC(LAST_UPDATE_DATE) BETWEEN TO_DATE('22-FEB-03','DD-MON-YY') AND TO_DATE('21-MAR-03','DD-MON-YY')
    Ideally I can't impose this becasue the query is a generarted query by one of the reporting tools.
    Kindly Help. I really appreciated your help in this regard.
    Thanks,
    Badhri ...

    Your NLS_DATE_FORMAT is set to something other than 'DD-MON-YY'. This can be changed at a session level by executing a query
    ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YY'
    You could also change this at an instance level, but that would likely have side-effects on other queries. One of the reasons that not having to_date can be a royal pain.
    Justin

  • Query the data between two tables

    Need help for query the data between two tables
    Table 1: Time sheet
    P.ID      P.Name EmpID HoursSpend DateTime
    c12234  Test      25        4                06/12/2013
    c12234  Test      25        7                06/13/2013
    c12234  Test      25        8                06/15/2013
    c12234  Test      5          3                06/21/2013
    c12234  Test      2          5                07/15/2013
    c12234  Test      25        4                07/21/2013
    Table 2: cost table
    EmpID  FromDate       ToDate         Rate
    25         05/01/2013    06/30/2013    250
    2         04/01/2013    05/31/2013      150
    25         07/01/2013     09/30/2013    300 
    Output
    P.ID      P.Name EmpID HoursSpend DateTime       Rate   Total (HoursSond x Rate)
    c12234  Test      25        4                06/12/2013    250     1000 (4*250)
    c12234  Test      25        7                06/13/2013    250      1750
    c12234  Test      25        8                06/15/2013    250      
    2000
    c12234  Test      25        4              07/21/2013     300       
    1200
    c12234  Test      2          5              07/15/2013    150          
    750
    ===========================================     
    Total                           28                                                 
    6700
    ============================================
    Here EmpID =2 don't have rate in the cost table on july month should be pick from last entry from cost table.

    Hi Gopal,
    According to your description, it seems that the output needn’t include the row when EmpID=2. Because the DateTime for it in Table1 doesn’t included between FromDate column and ToDate column. After testing the issue in my environment, we can refer to the
    query like below to achieve your requirement:
    SELECT time.*,cost.EmpID,cost.Rate,(time.HoursSpend * cost.Rate)as [Total (HoursSond x Rate)]
    FROM [Time sheet] as time
    INNER JOIN
    [cost table]as cost
    ON time.EmpID = cost.EmpID
    AND time.DateTime BETWEEN cost.FromDate AND cost.ToDate
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Sql Query for getting data between two dates

    Dear Sir,
    I have one problem, i have date stored in varchar datatype of (X) table in mysql as it was not supporting the date format of (dd/mm/yyyy) so know the problem is,
    When i going to get the data between the the two dates it is giving the un reliable answers such that
    when i am asking the query as data between 1st April to 31st December 2009 it is showing the data from the 2008 .
    is there any way to solve this problem,please help this is an urgent requirement, your replay will be helpful to me.
    With Regards
    Ramakrishna Y

    You either have a SQL problem and this is the incorrect place to ask.
    Or you have a Java problem in code we cannot see. When posting code use the code tags. Click the CODE button and paste your code between the tags that appear.

  • SQL query to get dates between two dates

    Hi,
    We have one table with start date and end date...Now i need to get all dates between start date and end date...
    Table looks like below..
    Create table date_table (start_date date,end_date date);
    Data in the table will be like below:
    start_date            end_date
    01-Jan-2013       04-Jan-2013
    01-Feb-2013       03-Feb-2013
    01-May-2013        03-May-2013
    I want a result as below..
    holiday_dates
    01-Jan-2013
    02-Jan-2013
    03-Jan-2013
    04-Jan-2013
    01-Feb-2013
    02-Feb-2013
    03-Feb-2013
    01-May-2013
    02-May-2013
    03-May-2013
    Can any one helps..?

    select * from date_table;
    START_DAT END_DATE
    01-JAN-13 04-JAN-13
    01-FEB-13 07-FEB-13
    07-MAR-13 12-MAR-13
    select start_date-1+level output from
    date_table connect by level<=end_date-start_date+1
    and prior start_date=start_date and prior sys_guid() is not null
    OUTPUT
    01-JAN-13
    02-JAN-13
    03-JAN-13
    04-JAN-13
    01-FEB-13
    02-FEB-13
    03-FEB-13
    04-FEB-13
    05-FEB-13
    06-FEB-13
    07-FEB-13
    07-MAR-13
    08-MAR-13
    09-MAR-13
    10-MAR-13
    11-MAR-13
    12-MAR-13

  • Generating a list of dates between 2 dates

    hi all,
    I have a table which looks something like this.
    Table_A
    (emp_id number,
    str_dt date,
    end_dt)
    Lets suppose the data is as below.
    emp_id str_dt end_dt
    1 01-may-2006 03-may-2006
    2 05-may-2006 12-may-2006
    3 06-jun-2006 08-jun-2006
    Now i need a query which will pivot this result above into something like given below and also generate the period of dates between str_dt and end_dt.
    Example output needed.
    emp_id dt
    1 01-may-2006
    1 02-may-2006
    1 03-may-2006
    2 05-may-2006
    2 06-may-2006
    3 06-jun-2006
    3 07-jun-2006
    Can someone please help me out here? I have tried with different ways, like using rownum from all_objects, etc, but to no avail.
    Your export opinion and help would be appreciated.
    Thanks in advance
    B

    Thanks a lot. All well nowEven if the cd's suggestion doesn't work whenever the period is greater than 31 days ?
      1* insert into table_a values (4,'A',to_date('06-jun-2006','dd-mon-yyyy'), to_date('08-aug-2006','dd-mon-yyyy'))
    SQL> /
    1 row created.
    SQL> ed
    Wrote file afiedt.buf
      1  SELECT emp_id, new_dt
      2    FROM (SELECT t.emp_id, t.str_dt, t.end_dt, t.str_dt + days.rn - 1 new_dt
      3            FROM table_a t,
      4                 (SELECT ROWNUM rn
      5                    FROM user_objects
      6                   WHERE ROWNUM <= 31) days
      7         )
      8   WHERE new_dt BETWEEN str_dt AND end_dt
    9 and emp_id=4
    10*  ORDER BY emp_id, new_dt
    SQL> /
        EMP_ID NEW_DT
             4 06/06/06
             4 07/06/06
             4 08/06/06
             4 09/06/06
             4 10/06/06
             4 11/06/06
             4 12/06/06
             4 13/06/06
             4 14/06/06
             4 15/06/06
             4 16/06/06
             4 17/06/06
             4 18/06/06
             4 19/06/06
             4 20/06/06
             4 21/06/06
             4 22/06/06
             4 23/06/06
             4 24/06/06
             4 25/06/06
             4 26/06/06
             4 27/06/06
             4 28/06/06
             4 29/06/06
             4 30/06/06
             4 01/07/06
             4 02/07/06
             4 03/07/06
             4 04/07/06
             4 05/07/06
             4 06/07/06
    31 rows selected.
    SQL> ed
    Wrote file afiedt.buf
      1  select a.emp_id, a.l_typ, b.column_value
      2  from   table_a a,
      3         (select column_value from table(period((select min(str_dt) from table_a),(select max(end_dt) from table_a)))) b
      4  where  b.column_value between a.str_dt and a.end_dt
    5 and emp_id=4
      6* order by 3
    SQL> /
        EMP_ID L COLUMN_V
             4 A 06/06/06
             4 A 07/06/06
             4 A 08/06/06
             4 A 09/06/06
             4 A 10/06/06
             4 A 11/06/06
             4 A 12/06/06
             4 A 13/06/06
             4 A 14/06/06
             4 A 15/06/06
             4 A 16/06/06
             4 A 17/06/06
             4 A 18/06/06
             4 A 19/06/06
             4 A 20/06/06
             4 A 21/06/06
             4 A 22/06/06
             4 A 23/06/06
             4 A 24/06/06
             4 A 25/06/06
             4 A 26/06/06
             4 A 27/06/06
             4 A 28/06/06
             4 A 29/06/06
             4 A 30/06/06
             4 A 01/07/06
             4 A 02/07/06
             4 A 03/07/06
             4 A 04/07/06
             4 A 05/07/06
             4 A 06/07/06
             4 A 07/07/06
             4 A 08/07/06
             4 A 09/07/06
             4 A 10/07/06
             4 A 11/07/06
             4 A 12/07/06
             4 A 13/07/06
             4 A 14/07/06
             4 A 15/07/06
             4 A 16/07/06
             4 A 17/07/06
             4 A 18/07/06
             4 A 19/07/06
             4 A 20/07/06
             4 A 21/07/06
             4 A 22/07/06
             4 A 23/07/06
             4 A 24/07/06
             4 A 25/07/06
             4 A 26/07/06
             4 A 27/07/06
             4 A 28/07/06
             4 A 29/07/06
             4 A 30/07/06
             4 A 31/07/06
             4 A 01/08/06
             4 A 02/08/06
             4 A 03/08/06
             4 A 04/08/06
             4 A 05/08/06
             4 A 06/08/06
             4 A 07/08/06
             4 A 08/08/06
    64 rows selected.
    SQL> Nicolas.

  • Getting a list of dates between 2 dates

    Hi All,
    Is there a way I can generate a list of date using a simple SELECT statement to generate all dates between to date points? For example between SYSDATE AND SYSDATE-7?
    One way I know is have a table and run PL/SQL script to put all dates in it and query that but was wondering if it can be achieve via SQL SELECT query at all without creating a table (querying DUAL).
    Cheers.
    Using Oracle XE 11GR2

    Arc_x wrote:
    If I wanted to make both days Inclusive how would I achieve that?Maybe: NOT TESTED!
    select to_date(:start_date,'yyyymmdd') + level - 1 generated_date
      from dual
    connect by level <= to_date(:end_date,'yyyymmdd') - to_date(:start_date,'yyyymmdd') + 1Regards
    Etbin

  • Between Query in Oracle

    Hi,
    Is it possible to fetch the value between the same date. When i use the below query with different date its working fine. but when i use the same query with same date it is not working.
    select m.doc_id,m.date from log m,content c
    where c.id= m.id and m.language = 'Spanish' and m.flag='1'
    and m.date between to_date('07-May-2010')
    and to_date('07-May-2010')
    Desc of log table is
    ID     NUMBER
    LANGUAGE     NOT NULL VARCHAR2(255)
    FLAG     NUMBER
    DATE     DATE
    Values as
    ID Language Flag Date
    1 Spanish 1 07-May-10
    2 English 1 07-May-10
    3 Spanish 1 07-May-10
    4 Spanish 0 07-May-10
    5 Spanish 1 08-May-10
    I want the result as
    1 Spanish 1 07-May-10
    3 Spanish 1 07-May-10
    same query should result in if we use the date range like 07-May-10 to 08-May-10
    Note there is no time frame in date field.
    Thanks,

    There's little point in using BETWEEN since the optimizer will turn it into <=, >= logic anyway.
    So, forget about it and use <=, > (whatever combination you require). Notice the predicate info here:
    SQL> explain plan for select * from dual where sysdate between to_date('01-JAN-2010') and to_date('31-DEC-2010');
    Explained.
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |     2 |     3   (0)| 00:00:01 |
    |*  1 |  FILTER            |      |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| DUAL |     1 |     2 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(SYSDATE@!<=TO_DATE('31-DEC-2010') AND
                  SYSDATE@!>=TO_DATE('01-JAN-2010'))

  • Data between one week or two dates

    select sysdate + rownum,
    ss.survey_name,
    (select count(*)
    from candidate_setup x
    where x.planned between '01-Nov-2008' and '01-Nov-2008'
    and x.survey_name = ss.survey_name) Planned,
    (select count(*)
    from candidate_setup x
    where x.forecast between '01-Nov-2008' and '01-Nov-2008'
    and x.survey_name = ss.survey_name) Forecast,
    (select count(*)
    from candidate_setup x
    where x.actual between '01-Nov-2008' and '01-Nov-2008'
    and x.survey_name = ss.survey_name) Actual
    from candidate_setup st, survey ss
    where ss.survey_id = st.survey_id
    output of the query
    SYSDATE+ROWNUM     SURVEY_NAME     PLANNED     FORECAST     ACTUAL
    05-Nov-08 7:19:55 PM     TSSR Submitted     0     0     0
    06-Nov-08 7:19:55 PM     TSSR Approved     0     0     0
    07-Nov-08 7:19:55 PM     Lease Submitted 0     0     0
    08-Nov-08 7:19:55 PM     Lease Approved     0     0     0
    but i want this
    Week Beginning     Date     CER Submitted          CER Approved          TSS Done          TSSR Submitted     
              Forecast     Actual     Forecast     Actual     Forecast     Actual     Forecast     Actual
    Monday     27-Oct-08     1     9     7     5     4     2     1     11     1     7     5     0     0
    Wednesda 29-Oct-08     2     9     4     1     0     0     1     5
    Thursday 30-Oct-08     4     0     3     0     2     0     1     0
    Friday     31-Oct-08     12     0     3     0     5     0     0     0
    Saturday 1-Nov-08     7     0     3     0     8     0     1     0
    Sunday     2-Nov-08     5     0     8     0     0     0     3     0
    Weekly Total          41     18     29     7     26     7     7     6
    Means shows the data between two given dates
    days + date between '01-Nov-2008' and '01-Nov-2008'
    and also compare these two dates in the query
    thanks

    p.s.
    If you want to show us code or data in a nice formatted manner that we can read, then surround it with {noformat}{noformat} tags.  ;)                                                                                                                                                                                                                                                                                                       

  • Oracle date parameter query not working?

    http://stackoverflow.com/questions/14539489/oracle-date-parameter-query-not-working
    Trying to run the below query, but always fails even though the parameter values matches. I'm thinking there is a precision issue for :xRowVersion_prev parameter. I want too keep as much precision as possible.
    Delete
    from CONCURRENCYTESTITEMS
    where ITEMID = :xItemId
    and ROWVERSION = :xRowVersion_prev
    The Oracle Rowversion is a TimestampLTZ and so is the oracle parameter type.
    The same code & query works in Sql Server, but not Oracle.
    Public Function CreateConnection() As IDbConnection
    Dim sl As New SettingsLoader
    Dim cs As String = sl.ObtainConnectionString
    Dim cn As OracleConnection = New OracleConnection(cs)
    cn.Open()
    Return cn
    End Function
    Public Function CreateCommand(connection As IDbConnection) As IDbCommand
    Dim cmd As OracleCommand = DirectCast(connection.CreateCommand, OracleCommand)
    cmd.BindByName = True
    Return cmd
    End Function
    <TestMethod()>
    <TestCategory("Oracle")> _
    Public Sub Test_POC_Delete()
    Dim connection As IDbConnection = CreateConnection()
    Dim rowver As DateTime = DateTime.Now
    Dim id As Decimal
    Using cmd As IDbCommand = CreateCommand(connection)
    cmd.CommandText = "insert into CONCURRENCYTESTITEMS values(SEQ_CONCURRENCYTESTITEMS.nextval,'bla bla bla',:xRowVersion) returning ITEMID into :myOutputParameter"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.ReturnValue
    p.DbType = DbType.Decimal
    p.ParameterName = "myOutputParameter"
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion"
    v.Value = rowver
    cmd.Parameters.Add(v)
    cmd.ExecuteNonQuery()
    id = CType(p.Value, Decimal)
    End Using
    Using cmd As IDbCommand = m_DBTypesFactory.CreateCommand(connection)
    cmd.CommandText = " Delete from CONCURRENCYTESTITEMS where ITEMID = :xItemId and ROWVERSION = :xRowVersion_prev"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.Input
    p.DbType = DbType.Decimal
    p.ParameterName = "xItemId"
    p.Value = id
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion_prev"
    v.Value = rowver
    v.Precision = 6 '????
    cmd.Parameters.Add(v)
    Dim cnt As Integer = cmd.ExecuteNonQuery()
    If cnt = 0 Then Assert.Fail() 'should delete
    End Using
    connection.Close()
    End Sub
    Schema:
    -- ****** Object: Table SYSTEM.CONCURRENCYTESTITEMS Script Date: 1/26/2013 11:56:50 AM ******
    CREATE TABLE "CONCURRENCYTESTITEMS" (
    "ITEMID" NUMBER(19,0) NOT NULL,
    "NOTES" NCHAR(200) NOT NULL,
    "ROWVERSION" TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL)
    STORAGE (
    NEXT 1048576 )
    Sequence:
    -- ****** Object: Sequence SYSTEM.SEQ_CONCURRENCYTESTITEMS Script Date: 1/26/2013 12:12:48 PM ******
    CREATE SEQUENCE "SEQ_CONCURRENCYTESTITEMS"
    START WITH 1
    CACHE 20
    MAXVALUE 9999999999999999999999999999

    still not comming...
    i have one table each entry is having only one fromdata and one todate only
    i am running below in sql it is showing two rows. ok.
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  '830' and  '850'  and t1.U_frmdate ='20160801'  and  t1.u_todate='20160830'
    in commond promt
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  {?FromEmid} and  {?ToEmid} and t1.U_frmdate ={?FDate} and  t1.u_todate={?TDate}
    still not showing any results..

  • Find to find date between 05/01/2003 and 05/29/2003

    Indeed, it's something about sql...
    I write a programme to have query on access database
    I try to
    sql="select * from PO where Date between to_date('05012003','mmddyyyy') and to_date('05292003','mmddyyyy')";
    but it's doesn't work...why?no (to_date) function in access??
    pls help!!

    When you are going through java to any database it uses a third party bridge that converts the SQL statements into something that the target database understands. Some of these third party bridges only conform to true SQL statements. Best to find out how the bridge functions.
    As such Java supports the ANSI SQL-2 standard.
    I imagine others will correct any errors in my statement, but I belive my answer is esentially right. Of course the jist of it is that you are going to have to find out how the particular bridge you are using handles date manipulations, It has little to nothing to do with the underlying database and everything to do with the connection bridge software.

  • Best way to pass secure data between servers

    Hello,
    In the not to distant future my company wants to expand our
    site to include a single sign-on, this will be made possible with
    the 3rd party group that handles our customer info. Can someone
    enlighten me as the most secure method of transferring user data
    between these locations?
    What has been proposed is to pass the login from our site to
    the 3rd party, if successful pass back certain data, display and
    possibly update on our site and then pass this back to the 3rd
    party server.
    Is CFLogin the most powerful method for login? I've used
    query checks in the past, is that adequate or is CFLogin much
    better? Any pointers are appreciated.

    "Is CFLogin the most powerful method for login? I've used
    query checks
    in the past, is that adequate or is CFLogin much better?"
    Neither, CFLogin is really just a specific purpose IF block.
    Code
    within the opening and closing <cflogin...> tags is run
    when a user is
    not logged in with the <cfloginuser...> tag. Inside
    this block one
    still needs to validate the credentials provided by the user,
    often with
    a query check.
    The <cflogin...><cfloginuser...> combination
    provides an easy to
    interpret and use mechanism to run conditional code and
    persist a user
    login state from request to request. It is basically
    equivalent to ones
    own <cfif...> logic combined with session data for the
    user state.
    Under the hood it is using the same mechanisms.
    I usually prefer to roll my own solution because I often want
    to store
    more state data about a user then is allowed with the
    <cfloginuser...>
    tag and the related getAuthUser() and isUserInRole()
    functions.

  • How to Reconcile Data Between SAP Source Systems and SAP NetWeaver BI

    Hi,
    I just read "How to Reconcile Data Between SAP Source Systems and SAP NetWeaver BI".  While I'm waiting for  more authorisation to r/3 to carry it out and test this functionality.
    I'd like to ask a question to anyone who has implemented this type solution.  On page 10 it talks about creating a view then setting up the datasource. The solution talks about runnig a query.  I suspect when we run a query I would run it for only a period(using variable) to reconcile.
    My question is this.  Will the datasource extractor on /r3 only select the period in our variable or will it do a full selection of the data which would then be passed to BW for filtering?
    Regards

    DEar Mark,
    There are several avenues where you can see and reconcile your data with source system, u can see data in by tcode RSA3 for a datasource, and compare the values with actual document posted into the R/3 system. Respective fuctional consultant canhelp you a lot to confirm the data.
    On BW side u can see the data in PSA and then check tranformations which subsequent change/update/reject data records based on the selective conditions.
    hope this helps.
    Kindly assign the points if it works.
    Revert back if u need futher help/information.

  • Display all dates between date range (Time Dimension left outer join Fact)

    All,
    I have done some searching around this issue but within all the posts regarding date variables, date prompts and date filtering I haven't seen one exactly answering my issue (maybe they are and I just dont have my head around it correctly yet).
    My report requirement is to allow a user to select a start day and an end day. The report should show all activity between those two days - AND display 0/null on days where there is no activity. That second part is where I am getting hung up.
    The tables in question are:
    TimeDim
    EventFact
    CustomerDim
    My BMM is setup as follows:
    TimeDim left outer join EventFact
    CustomerDim inner join EventFact
    If I run a report selecting DAY from TimeDim and a measure1 from EventFact with day range 1/1/2010 - 12/31/2010 .. I get a record for every day and it looks perfect because of the left outer join between TimeDim and CustomerDim.
    But .. if I add in a field from CustomerDim, select TimeDim.DAY, CustomerDim.CUSTNAME, EventFact.MEASURE1, OBIEE only returns records for the days that have EventFact records.
    This is due to the fact that the TimeDim is still outer joined into EventFact but adding in CustomerDim makes OBIEE setup an inner join between those tables which then causes only data to be returned where EventFact data exists.
    There is a way around this in this simple case and that is to define the relationship between CustomerDim and EventFact as an outer join as well. This will give the desired effect (but an outer join between these two tables is not the true relationship) and as I add additional dimensions and add additional logical sources to a single dimension in the BMM it gets complicated and messy.
    Ive also messed with setting the driving table in the relationship, etc.. but it has not given the desired effect.
    Has anyone ever encountered the need to force display all dates within a specfied range with a fact table that may not have an entry for every date?
    Thanks in advance.
    K
    Edited by: user_K on Apr 27, 2010 11:32 AM

    It worked!!!* Even my time drill downs and date based filtering still work!
    That is awesome. Never would have thought of that intuitively.
    Now, just need a little help understanding how it works. When I run my report and check the logs I can see that two queries are issued:
    Query 1: Joins the fact table to all the associated dimensions. I even changed all the relationships to inner joins (which is what they truly are). And calculates the original measure. If I copy and paste this query into sql developer it runs fine but only returns those rows that joined to the time dimension - which is what was happening before. It is correct but I wanted a record for every time dimension record.
    Query 2: Looks like the following:
    select sum(0)
    from timedim
    where date between <dateprompt1> and <dateprompt2>
    group by month *<--* this is the time dimension level specified in Query 1, so it knows to aggregate to the month level as was done in query 1
    Final Question: So what is OBIEE doing ultimately, does it issue these two requests and then perform a full outer join or something to bring them together? I couldn't see anywhere in the log a complete query that I could just run to see a similar result that I was getting in Answers.
    Thanks for all the help .. Id give more points if I could.
    K

Maybe you are looking for

  • How do I download Mac App Store to my MacBook Pro. Somehow, it was deleted

    Somehow, Mac App Store has been deleted from my MacBook Pro (Mac OS X version 10.6.8) How do I download this back to my MacBook Pro?

  • Error while creating sales order thru IDoc

    Hi,   While using FM IDOC_WRITE_AND_START_INBOUND, I am getting an error 'Customer not found with DUNS number from IDoc' and the application document is nor posted. I am passing valid customers in the ship to party and sold to party segments but stil

  • Print button option, is there one?

    Im looking for a way to add the Print function when adding interactive/button options to a button within indesign. Short of adding the print function to my final art PDF using the tools within Acrobat, how can I skip that step and add the print funct

  • The end of jagged edges in iMovie using stills

    It took an astonishing 14 months, but I have finally beaten the dreaded jagged edge quality issue in iMovie when using still photos. If you're reading this, you're a sufferer. How could the software be so bad as to ruin every picture you put in there

  • Security component implementation

    I'm working on a security component that will grant access (or deny access) to protected resources through a password verification, in a JSF RI website. Can you tell me, in your opinion, what is the best practises to achieve this? Can I rely on the s