Link tables based on a date

I'm trying to link 2 tables A and B together.
For every entry in A there is either 0, 1 or many entries in B.
What I am trying to do is find whichever entry in B has the earliest date in it.
eg
A
PKid 
1
B
FKid  | date
1       | 01/01/2005
1       | 12/12/2006
1       | 31/12/2007
So in this instance I only want the data from the first row, with the date 01/01/2005.
Is this possible in CR XI?

Hi,
maybe you can use the join? of two tables?
Look for Linking options within Crystal Reports Help file.
Many thanks
Kind Regards
Jehanzeb

Similar Messages

  • Build a table based on XML data set with Spry

    Hi there,
    I'm new to spry technology therefore forgive any basic question of mine.
    I'm trying to fill content in a table based on XML data set values but nothing is shown :-(
    here is my code.... any suggestion? pls tell me where I'm wrong.
    Thank you in advance
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    var uscite = new Spry.Data.XMLDataSet("data/Calendario 2011.xml", "csv_data_records/record", {sortOnLoad: "Date", sortOrderOnLoad: "ascending"});
    uscite.setColumnType("Date", "date");
    uscite.setColumnType("km", "number");
    </script>
    <div class="RankContainer" id="UsciteDiv" spry:region="uscite" >
              <table width="100%" border="0" class="RankTable">
                <tr>
                  <th width="10%" scope="col" spry:sort="Date">Data</th>
                  <th width="20%" scope="col">Destinazione</th>
                  <th width="5%" scope="col">KM</th>
                  <th width="35%" scope="col">Percorso</th>
                  <th width="30%" scope="col">Breve</th>
                 <!-- <th width="15%" scope="col">Mappa</th>-->
                </tr>
                <tr>
                   <script type="text/javascript">
           var rows = uscite.getData();
        for (var i = 0; i < rows.length; i++)
         if (rows[i]["Mappa"].startsWith("/"))
          rowContent = "<td> si </td>";
         else
              rowContent = "<td> no </td>";
         document.write("<td>{Date}</td>");
         document.write("<td>"+rowContent+"</td>");
         document.write("<td>{km}</td>");
         document.write("<td>{Percorso}</td>");
         document.write("<td>{Breve}</td>");
          </script>
               </tr>
              </table>
           </div>

    Sure this is how it should work (except that no anchor tag shall be present for Destinazione whereas Mappa has no real value in)
    http://www.gsc-borsano.it/_Calendario%202011.html
    and this is the non working page
    http://www.gsc-borsano.it/_v2Calendario%202011.html
    Thanks

  • Is it possible to find the  table based on the Date ?

    Dear Team ,
    Is it possible to find the table based on the Date ?
    I have created an table ,But forgot the Table Name .
    Is it possible to find the Tables created on particular Date .
    Regards ,
    Augustine

    as date is record the time also below query will work.
    select * from user_objects
    where
    object_type = 'TABLE' and
    to_date(created,'DD-MON-YYYY') =to_date('<your date value in DD-MON-YYYY format>','DD-MON-YYYY');
    Edited by: shaileshM on Feb 24, 2010 9:39 PM

  • Question on updating a table based on report data

    Hi all,
    I am building a new stock request form for our site and I have a report that provides a listing of all requests that have a status of pending based on supv_approve flag being Null.
    I want to be able to update the table BGNA_NEW_STOCK_REQUESTS and set SUPV_APPROVE Flag to either Y or N depending on what the user sets as the value in the report. (by changing the standard report column to a text field and setting it to a named LOV with values Y or N, I can change each row in the displayed report to either be Y or N - but have yet to figure out how you then update the table with those values)
    Each row of the report has a unique ID - I just havent figured out how you update a table by chaging the values displayed in a report. I get that I can change the feild type from standard report column to text field but havent figured out how to get an update button to actually update the table once I changed the NULL value to Y or N
    any help is greatly appreciated!
    Edited by: user8607582 on Aug 10, 2009 1:51 PM
    Edited by: user8607582 on Aug 10, 2009 1:58 PM

    Hello Danny,
    Add a column to the sql that is something like this:
    select apex_item.checkbox(1,<keyfieldname> "Approved", (then the rest of your query for your report).
    This will put a check-box on your report. Move it to the beginning of the line for a better user-interface.
    When the user clicks the "Submit" button, ONLY those lines that have a check in the box are sent back. Create a process on your page that does the following:
    for i in 1..apex_application.g_f01.count Loop
    <do the processing of Approved transactions using this syntax for your update processing... where <keyfieldname> = apex_application.g_f01(i);
    <set all of the remaining as "N" if you wish or leave the supervisor's approval as NULL>
    end loop;
    This will then allow you process all of those items that were checked.
    I hope this helps,
    Don.
    You can reward this reply by marking it as either Helpful or Correct :)

  • Table based on one data service but filtered by a second data service

    Hi,
    I'm fairly new to VC and have got comfortable with a few simple scenarios. However, I'm trying to apply some fundamental logic that must be possible and I'm guessing straight forward.
    I have a data service that contains document type master data that comes from system A. I have a second data service that supplies a list of the document types that a particular user is able to view. This comes from system B. I want to be able to display the document type master data in a table but only the document types the user is allowed to see. Both data services contain a document type code.
    If anyone can point me in the right direction I would really appreciate it. We want to use VC on my current project and this is the last piece of functionality I'm trying to prototype.
    Many Thanks
    Gary

    Hi,
    I am not sure whether you have tried to achieve your requirement using intersect operator or no. I haven't tried it before but you can give it a shot.
    Regards,
    Murtuza

  • Retriev Top to columns of table based on latest date

    Hi all,
    I have the below table
    Date                 
    Value
    1/1/2012            1000
    1/1/2013            2000 
    1/1/2014            3000
    I need a querry which will fetch the latest two dates and values. ie it should retrieve as below
    Date                  
    Value
    1/1/2013            2000 
    1/1/2014            3000
    Thanks in advance.

    SELECT TOP 2 * FROM tbl ORDER BY Date DESC
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to populate data in the same table based on different links/buttons

    Hi
    I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
    Can anyone please suggest how can this be achieved.
    Thanks

    I have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
    What format do you have the date in - table / form ?

  • How to create a sharepoint list to add/change/delete the data in SQL server Table based on users inputs

    I have a table in sql with employee_num and I need to create a list and link that list to this table to make changes to table based on values user enter or selects.

    Hi,
    In addition, you could refer to one similar thread for related information:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/8ee8a7b2-ddfc-4654-b84e-b062aeb527ae/how-to-create-exernal-list-in-sharepoint-which-fetch-data-from-multiple-sql-table?forum=sharepointgeneral
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How to Bind a Combo Box so that it retrieves and display content corresponding to the Id in a link table and populates itself with the data in the main table?

    I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables:
    1. Party (PartyId, Name)
    2. Case (CaseId, CaseNo)
    3. Petitioner (CaseId, PartyId) ............. Link Table
    I am completely new to .Net and to begin with I download Microsoft's sample application and
    following the pattern I have been successful in creating several tabs. The problem started only when I wanted to implement many-to-many relationship. The sample application has not covered the scenario where there can be a any-to-many relationship. However
    with the help of MSDN forum I came to know about a link table and managed to solve entity framework issues pertaining to many-to-many relationship. Here is the screenshot of my application to show you what I have achieved so far.
    And now the problem I want the forum to address is how to bind a combo box so that it retrieves Party.Name for the corresponding PartyId in the Link Table and also I want to populate it with Party.Name so that
    users can choose one from the dropdown list to add or edit the petitioner.

    Hello Barry,
    Thanks a lot for responding to my query. As I am completely new to .Net and following the pattern of Microsoft's Employee Tracker sample it seems difficult to clearly understand the concept and implement it in a scenario which is different than what is in
    the sample available at the link you supplied.
    To get the idea of the thing here is my code behind of a view vBoxPetitioner:
    <UserControl x:Class="CCIS.View.Case.vBoxPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:v="clr-namespace:CCIS.View.Case"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    d:DesignWidth="300"
    d:DesignHeight="200">
    <UserControl.Resources>
    <DataTemplate DataType="{x:Type vm:vmPetitioner}">
    <v:vPetitioner Margin="0,2,0,0" />
    </DataTemplate>
    </UserControl.Resources>
    <Grid>
    <HeaderedContentControl>
    <HeaderedContentControl.Header>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <TextBlock Margin="2">
    <Hyperlink Command="{Binding Path=AddPetitionerCommand}">Add Petitioner</Hyperlink>
    | <Hyperlink Command="{Binding Path=DeletePetitionerCommand}">Delete</Hyperlink>
    </TextBlock>
    </StackPanel>
    </HeaderedContentControl.Header>
    <ListBox BorderThickness="0" SelectedItem="{Binding Path=CurrentPetitioner, Mode=TwoWay}" ItemsSource="{Binding Path=tblParties}" />
    </HeaderedContentControl>
    </Grid>
    </UserControl>
    This part is working fine as it loads another view that is vPetioner perfectly in the manner I want it to be.
    Here is the code of vmPetitioner, a ViewModel:
    Imports Microsoft.VisualBasic
    Imports System.Collections.ObjectModel
    Imports System
    Imports CCIS.Model.Party
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' ViewModel of an individual Email
    ''' </summary>
    Public Class vmPetitioner
    Inherits vmParty
    ''' <summary>
    ''' The Email object backing this ViewModel
    ''' </summary>
    Private petitioner As tblParty
    ''' <summary>
    ''' Initializes a new instance of the EmailViewModel class.
    ''' </summary>
    ''' <param name="detail">The underlying Email this ViewModel is to be based on</param>
    Public Sub New(ByVal detail As tblParty)
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Me.petitioner = detail
    End Sub
    ''' <summary>
    ''' Gets the underlying Email this ViewModel is based on
    ''' </summary>
    Public Overrides ReadOnly Property Model() As tblParty
    Get
    Return Me.petitioner
    End Get
    End Property
    ''' <summary>
    ''' Gets or sets the actual email address
    ''' </summary>
    Public Property fldPartyId() As String
    Get
    Return Me.petitioner.fldPartyId
    End Get
    Set(ByVal value As String)
    Me.petitioner.fldPartyId = value
    Me.OnPropertyChanged("fldPartyId")
    End Set
    End Property
    End Class
    End Namespace
    And below is the ViewMode vmParty which vmPetitioner Inherits:
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Collections.Generic
    Imports CCIS.Model.Case
    Imports CCIS.Model.Party
    Imports CCIS.ViewModel.Helpers
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' Common functionality for ViewModels of an individual ContactDetail
    ''' </summary>
    Public MustInherit Class vmParty
    Inherits ViewModelBase
    ''' <summary>
    ''' Gets the underlying ContactDetail this ViewModel is based on
    ''' </summary>
    Public MustOverride ReadOnly Property Model() As tblParty
    '''' <summary>
    '''' Gets the underlying ContactDetail this ViewModel is based on
    '''' </summary>
    'Public MustOverride ReadOnly Property Model() As tblAdvocate
    ''' <summary>
    ''' Gets or sets the name of this department
    ''' </summary>
    Public Property fldName() As String
    Get
    Return Me.Model.fldName
    End Get
    Set(ByVal value As String)
    Me.Model.fldName = value
    Me.OnPropertyChanged("fldName")
    End Set
    End Property
    ''' <summary>
    ''' Constructs a view model to represent the supplied ContactDetail
    ''' </summary>
    ''' <param name="detail">The detail to build a ViewModel for</param>
    ''' <returns>The constructed ViewModel, null if one can't be built</returns>
    Public Shared Function BuildViewModel(ByVal detail As tblParty) As vmParty
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Dim e As tblParty = TryCast(detail, tblParty)
    If e IsNot Nothing Then
    Return New vmPetitioner(e)
    End If
    Return Nothing
    End Function
    End Class
    End Namespace
    And final the code behind of the view vPetitioner:
    <UserControl x:Class="CCIS.View.Case.vPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    Width="300">
    <UserControl.Resources>
    <ResourceDictionary Source=".\CompactFormStyles.xaml" />
    </UserControl.Resources>
    <Grid>
    <Border Style="{StaticResource DetailBorder}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBlock Grid.Column="0" Text="Petitioner:" />
    <ComboBox Grid.Column="1" Width="240" SelectedValuePath="." SelectedItem="{Binding Path=tblParty}" ItemsSource="{Binding Path=PetitionerLookup}" DisplayMemberPath="fldName" />
    </Grid>
    </Border>
    </Grid>
    </UserControl>
    The problem, presumably, seems to be is that the binding path "PetitionerLookup" of the ItemSource of the Combo box in the view vPetitioner exists in a different ViewModel vmCase which serves as an ObservableCollection for MainViewModel. Therefore,
    what I need to Know is how to route the binding path if it exists in a different ViewModel?
    Sir, I look forward to your early reply bringing a workable solution to the problem I face. 
    Warm Regards,
    Arun

  • How to get a block of data from internal table based on a criteria

    Hi all,
              I have some records in the internal table t_int1. I want to retrieve some set records from that table and put them all in some other table, based on a single field which is not  a key. Can i use READ statement to achieve this.
    Could you please let me know any simple way of doin this.
    Regards,
    Vishnu

    I have some records in the internal table t_int1. I want to retrieve some set records from that table and put them all in some other table, based on a single field which is not a key. Can i use READ statement to achieve this.
    Could you please let me know any simple way of doin this.
    Answer :
    data:
    itab2 like standard table of  t_int1 with header line.
    Loop at t_int1.
    read table t_int1 with index 1.
    check ur condition----
    check each line and insert it ---work out the syntax for this
    IF t_int1-xyz = data1
    append  line of t_int1 to itab2. or try insert
    cnt = cnt + 1   -
    u will get no. of records added to next itab.
    else.
    cnt1 = cnt1 + 1 -
    u will get no. of records not added to next itab.
    endif.
    end loop.

  • Creation of internal table dynamically based on the Date Range entered

    Hi SAPgurus,
    I have been facing one issue i.e creation of internal table dynamically based on the date range entered in the selection screen. For example the date range I am giving as 06/2006 to 08/2006, it should display the Fieldcatelog dynamically, this part i have completed but the only issue I am facing is to populate the sales data into that fields.
    Right now my program is displaying the ALV like this.
    Ex:
    <b>CSR    District   06/2006  07/2006  08/2006  totals</b>      
    Shiva      New York                             10.00
    Shiva      new york                             30.00
    Shiva      new york                             40.00
    but it should display like this
    <b>CSR    District 06/2006 07/2006 08/2006 totals</b>
    Shiva  New York  10.00   30.00 40.00
    80.00                 
    Please help me in this scenario, how to acheive like this..
    Thanks & Regards,
    Sivaram Kandula

    Hi Sivaram,
                 I also got the same requirement . i saw rich and your code whatever you have uploaded.i have created dynamic internal table but i am facing the issue to populating the data to my dynamic internal table.
    Sivaram, can you please explain your code after this.
    *<dyn_table>
    *tab_item.
      LOOP AT tab_item.
        ASSIGN COMPONENT 1 OF STRUCTURE <dyn_wa> TO <dyn_table>.
        ASSIGN COMPONENT 2 OF STRUCTURE <dyn_wa> TO <dyn_table>.
    *    <dyn_wa> = tab_item-bztxt.
    *    <dyn_wa> = tab_item-total.
    *    APPEND <dyn_wa> TO <dyn_table>.
    **    <dyn_wa> = tab_item-total.
    **    ASSIGN tab_item-bezei  TO <dyn_wa>.
    *  APPEND <dyn_table>.
      ENDLOOP.
    how you are puting the loop at tab_item. but tab_item is already commented.
    can you send me the code after that.
    i am sending some part of my code.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
       EXPORTING
         it_fieldcatalog = gt_fCAT1
       IMPORTING
         ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
       create data new_line like line of <dyn_table>.
       assign new_line->* to <dyn_wa>.
    select vbeln
            fkart
            vkorg
            vtweg
            fkdat
            spart
            fksto
            from vbrk
            client specified
            into table gt_vbrk
            where mandt = sy-mandt
            and fkart in ('ZF5','ZFR')
            and vkorg = '1100'
            and vtweg = '20'
            and fkdat in s_fkdat
            and spart = '06'
            and fksto = ' '.
       if gt_vbrk[] is not initial.
      select  vbeln
              fkimg
              prsdt
              netwr
              matnr
              arktx
              werks
              mwsbp
              from vbrp
              client specified
              into table gt_vbrp
              for all entries in gt_vbrk
              where vbeln = gt_vbrk-vbeln
              and werks in s_werks
              and matnr in s_matnr.
      endif.
    select mnr ltx spras from t247
    into table it_t247
    where spras = 'E'.
    data: lv_month1 type vbrp-prsdt,
           name1(3) type c,
           s_month type string,
            s_month1 type string,
             s_month2 type string.
    *      lv_netwr1 type vbrp-netwr,
    *          lv_mwsbp1 type vbrp-mwsbp.
          loop at gt_vbrp into gs_vbrp.
            gs_final2-matnr = gs_vbrp-matnr.
            gs_final2-arktx = gs_vbrp-arktx.
            gs_final2-fkimg = gs_vbrp-fkimg.
           lv_month1 = gs_vbrp-prsdt.
            read table it_t247 into wa_t247 with key mnr = lv_month1+4(2).
            if sy-subrc eq 0.
            name1 =  wa_t247-ltx.
            endif.
             concatenate  name1
                       lv_month1(4) into s_month SEPARATED BY '_' .
             CONCATENATE S_MONTH 'QTY' INTO S_MONTH1 SEPARATED BY ''.
              CONCATENATE S_MONTH 'VALUE' INTO S_MONTH2 SEPARATED BY ''.
             gs_final2-month = s_month.
              lv_netwr1 = gs_vbrp-netwr.
            lv_mwsbp1 = gs_vbrp-mwsbp.
            gs_final2-MONTH_QTY = S_MONTH1.
            GS_FINAL2-MONTH_VAL = S_MONTH2.
            gs_final2-value = lv_netwr1 + lv_mwsbp1.
           append gs_final2 to gt_final2.
           clear: gs_final2. "lv_name2.
           endloop.
           if gt_final2[] is not initial.
             sort gt_final2 by matnr month ascending .
             loop at gt_final2 into gs_final2.
            gs_final2_01 = gs_final2.
         collect gs_final2_01 into gt_final2_01.
        endloop.
           endif.
       ENDIF..
    Regards
    Ankur

  • Header row in ALV Grid, based on the data in the table

    Hi All,
    I have a requirement wherein, based on the data in the table used for ALV, i need to add rows as sort of header in the ALV display.
    For e.g. my table has
    Appl No.  Item  Material  Desc.           Cost                 -> Column Heading
    1             10     400        Excavation    10.00               -> Data
    1             20     400        Footing         10.00
    2             10     400        Excavation    10.00
    2             20     400        Footing         10.00
    For every new Appl No., i need to add a row, or sort of header specifying the appl no. details. means
    Appl No.  Item  Material  Desc.           Cost
    Appli. No. 1                   Date: 01/01/1009                   -> my requirement
    1             10     400        Excavation    10.00
    1             20     400        Footing         10.00
    Appli. No. 2                   Date: 02/01/1009
    2             10     400        Excavation    10.00
    2             20     400        Footing         10.00
    Is this possible in ALV my any means? Currently i m using normal ALV Grid
    Regards,
    Janaki

    Hi..
         Try like this... I think u have Application number and date in ur table ... First get the total table data into internal table.. and to add the row
         *Declare the var1 as 0 and var2.
    loop at internal table
         *var1 = var1 +1
    when application number =var1
             concatenate : 'Appli. No.' (table- appli no field) 'Date:'  (table-date field) into var2.
    perform display(some name)
         *endloop.
         *form display...
              alv display part.. first give that var2 like eg.. wa_alv-field= 'var2'.
    end form.
        Hope this will help u .....
    Regards,
    Abaper

  • Need to fetch value from a table based on data range

    Hello there,
    I was hoping that the community could give me a hand with this little puzzle I got.
    I am currently creating a Time Dimension for a data wharehouse, and I have the requirement to populate a column named SEASON (e.g: Summer, Winter, Spring, Autumn) for each date row. So for the 20/Dec/2013, the Season column must say Winter.
    Here is now my Time Dimension table looks like, without the Season information (which I yet have to load):
    DimTime Table
    TIMEID
    FULLDATE
    YEAR
    SEASON
    MONTH
    MONTHDAY
    WEEK
    WEEKDAY
    274
    02-MAR-10
    2010
    3
    2
    9
    2
    275
    03-MAR-10
    2010
    3
    3
    9
    3
    276
    04-MAR-10
    2010
    3
    4
    9
    4
    277
    05-MAR-10
    2010
    3
    5
    9
    5
    278
    06-MAR-10
    2010
    3
    6
    9
    6
    279
    07-MAR-10
    2010
    3
    7
    9
    7
    This entire table is being populated using Oracle functions to manipulate a date field from another table, named PDATE:
    My ETL Code
    INSERT INTO DimTime(timeid, fulldate, year, month, monthday, week, weekday)
    SELECT tim_seq.NEXTVAL, pdate, year, month, monthday, week, weekday
    FROM (SELECT DISTINCT pdate, EXTRACT(year from pdate) year, EXTRACT(month from pdate) month,
    EXTRACT(day FROM pdate) monthday, to_number(to_char(to_date(pdate,'DD/MM/YY'),'IW')) week,
    TO_CHAR(pdate, 'D') weekday
    FROM Performance PER
    ORDER BY pdate);
    NOTE: Code considers the table DimTime to be truncated every time it loads (i.e.: I don't need to consider additional loads).
    As you can see, Season wasn't populated. Since the solstices and equinoxes vary for each year, I can't just say that Summer start at a given date (e.g: 21 of June) because one year it could be the 19/Jun, another the 22/Jun, etc. So in order to solve this problem, I have a table named Season which defines the START and END dates for the seasons:
    Season Table
    SEASON#
    SEASONNAME
    YEAR
    DATEFROM
    DATETO
    1
    Spring
    2010
    01-MAR-10
    30-MAY-10
    2
    Summer
    2010
    31-MAY-10
    29-AUG-10
    3
    Autumn
    2010
    30-AUG-10
    28-NOV-10
    4
    Winter
    2010
    29-NOV-10
    27-FEB-11
    5
    Spring
    2011
    28-FEB-11
    29-MAY-11
    6
    Summer
    2011
    30-MAY-11
    28-AUG-11
    7
    Autumn
    2011
    29-AUG-11
    27-NOV-11
    8
    Winter
    2011
    28-NOV-11
    26-FEB-12
    9
    Winter
    2009
    30-NOV-09
    28-FEB-10
    This is the bit I don't know how to do. How can I make sure that I populate the correct Season in my DimTime table based on the season specified in the Season table?
    Thanks in advance for your help!
    Regards,
    P.

    Just join to table Season:
    INSERT
      INTO DimTime(
                   timeid,
                   fulldate,
                   year,
                   month,
                   monthday,
                   week,
                   weekday,
                   seasonname
      SELECT  tim_seq.NEXTVAL,
              pdate,
              year,
              month,
              monthday,
              week,
              weekday
        FROM  (
               SELECT  DISTINCT pdate,
                                EXTRACT(year from pdate) year,
                                EXTRACT(month from pdate) month,
                                EXTRACT(day FROM pdate) monthday,
                                to_number(to_char(to_date(pdate,'DD/MM/YY'),'IW')) week,
                                TO_CHAR(pdate,'D') weekday,
                                seasonname
                 FROM  Performance PER,
                       season
                 WHERE pdate between datefrom and dateto
    SY.

  • To select from database table based on date range

    hi
    i have a selection screen in which date range is being given
    say eg 23/06/07  to 23/12/08
    based on this date i want to select data from a ztable
    eg i want to select a field amount from table
    and three is a field date range on the table
    for this particular field i want to select all records for amount field  and factual field falling wiithing this date range and sum it
    eg
    based on date range as in selcetion screen
    select amount( field1)  factual ( field2) from ztable into it_ztable where date = ?....
    please give me code for it  and how to sum all values as i will get from the ztable into internal table the two values as fetched from the ztable
    please suggest asap
    regards
    arora

    hi
    i am using
    sELECT field1 field2 FROM Ztable  INto it_matu
                       where DATE GE sl_dat-low    
                        AND  DATE LE sl_dat-high.   
    i am getting data in internal table but
    say i have twelve records now i want to sum it the both the columns into and use that sum final amount to display
    let me know how to use sume in the intrranal tabl do i need to use control statement
    how to use the sum for two columns and take into a serperate variable to display
    regards
    aRora

  • Why data change in linked table in Access - link from Oracle DB

    Can someone please help me to solve this situation? I try to find out why data is changed from Oracle to Access. I must come back to this thread because lot of data in my Oracle database is defined as NUMBER(22), and I am using Access heavily.
    Here is the problem:
    In Access, I created ODBC connection (System DSN) to Oracle 9.2 database by using Oracle driver (NOT Microsoft ODBC for Oracle). Then I linked tables from Access with the Oracle table. What happens is that the number in Access linked table is displayed as a scientific number. Is there a way that I can preserve whatever I have in Oracle database?
    For example:
    Comp_ID in Oralce is defined as NUMBER(22) = 40000000000324003; In Access it looks like this 4.0000000000324E+16.
    What I have in my system:
    1- Oracle 9.2 client
    2- Oracle driver
    3- Access 2003
    4- Jet - SP 8

    Can someone please help me to solve this situation? I try to find out why data is changed from Oracle to Access. I must come back to this thread because lot of data in my Oracle database is defined as NUMBER(22), and I am using Access heavily.
    Here is the problem:
    In Access, I created ODBC connection (System DSN) to Oracle 9.2 database by using Oracle driver (NOT Microsoft ODBC for Oracle). Then I linked tables from Access with the Oracle table. What happens is that the number in Access linked table is displayed as a scientific number. Is there a way that I can preserve whatever I have in Oracle database?
    For example:
    Comp_ID in Oralce is defined as NUMBER(22) = 40000000000324003; In Access it looks like this 4.0000000000324E+16.
    What I have in my system:
    1- Oracle 9.2 client
    2- Oracle driver
    3- Access 2003
    4- Jet - SP 8

Maybe you are looking for

  • SAP MM questions- help needed

    Please can I get an expert's help in findig a solution to the following questions: 1 To view the most up to date planning data (available stock, orders, reservations, etc.) on a material, use the: (more than one answer can be correct) A Stock Overvie

  • Missing iWorks after system restore

    I am using a work machine and wanted to do a wipe and restore of mavericks because when I upgraded the iWorks that came on it I accidentally used my personal apple Id and not the developer Id I use at work. But when the restore finished I am missing

  • Results Of The Oracle Certification 2009 Salary Survey

    !http://blogs.oracle.com/certification/0116.jpg! *<p>The results of the Oracle Certification Program's 2009 Salary Survey, which was administered via the Internet earlier this year have been released.</p>*<p align="justify">Responses from Oracle Cert

  • Rename a chosen file

    hey, I´ve some probs with renaming files...here´s how it goes: I browse for a file and want to rename it. the new name is already generated. and now I just want to replace the old name of the file with my new generated one and "save" this to the file

  • What is a disk serial number and where can I find it on my Mac?

    I'm trying to gain access to a Software program that requires a disk serial number to generate a license. Where can I find this information?