SSRS Prior and Next Functions

I have several reports in Hyperion that I use the next and prior functions to look at the row right before and/or the row after.
To do this, I sort the data in a certain way to make sure the prior or next functions in hyperion find the right rows above or below the current row. For example, I may sort 2 other rows to get the right sorting for the functions to work correctly.
Now I would like to be able to find a way to recreate these reports in Access and SSRS.
I have been looking for a way to accomplish this in either or both.  But at the moment I have not found a way.
If I need a unique field to help with this, I can concatenate between about 4 fields to make a column that has a unique key for each row.
Could anyone point me at a good article or know how to do this?  I would really appreciate it very much, thank you!

Hi grahamtribe,
Based on my research, there is no such next function in Reporting Services. We can use custom code with VB code to write a function to achieve the similar goal. For more details, please see:
Add Code to a Report (SSRS)
Alternatively, if you have any concern about this, please submit a feedback at
https://connect.microsoft.com/SQLServer/Feedback. Connect site is a connection point between you and Microsoft, and ultimately the larger community. Your feedback enables Microsoft to make software and services the best that they can be, and you can learn
about and contribute to exciting projects.
Thank you for your understanding.
Regards,
Katherine Xiong
Katherine Xiong
TechNet Community Support

Similar Messages

  • Variables for prior and next periods in logic

    Hi,
    I'd like to do something that I would have thought should be quite simple, but I just haven't managed to get it right.
    In Category, we use the properties Year and Month. For example:
    Member  Year     Month
    Actual     2014     APR
    SP          2016     DEC
    The issue is that we would like to create SP (Strategic Plan) for 3 years, of which the year in the property, 2016, is the first.
    Creating variables for the month and for the first SP year is simple:
    *SELECT(%CYEAR_SP%,"[YEAR]","CATEGORY","[ID]= 'SP'")
    *SELECT(%CMONTH_SP%,"[MONTH]","CATEGORY","[ID]= 'SP'")
    I'd then like to  dynamically create 3 variables based on properties Year and Month; %SP1%, %SP2% and %SP3%, that I can use in scoping, in *WHEN/*IF, in GET and in *REC. It should be something like:
    %SP1% = %CYEAR_SP%.%CMONTH_SP% (2016.DEC)
    %SP2% = %CYEAR_SP%(+1).%CMONTH_SP% (2017.DEC)
    %SP3% = %CYEAR_SP%(+2).%CMONTH_SP% (2018.DEC)
    However it doesn't seem possible to use mathematical expressions for this, and I haven't managed to use NEXT or PRIOR successfully either.
    Has anybody out there encountered this?
    /Cecilia

    Thanks Roberto! Square brackets for Year in *SELECT was the syntax solution, works like a charm!.
    I developed this further by creating new variables concatenating the year and  month:
    *SELECT(%SP1%,"[ID]","TIME","[ID]='%CYEAR_SP%.%CMONTH_SP%'")
    *SELECT(%SP2%,"[ID]","TIME","[ID]='%CYEAR_SP2%.%CMONTH_SP%'")
    *SELECT(%SP3%,"[ID]","TIME","[ID]='%CYEAR_SP3%.%CMONTH_SP%'")
    /Cecilia

  • Running total and Next function in Crosstab

    <strong><font size="3"><font face="Times New Roman">Clarifications on getting Next Running sum and count on a Crosstab</font></font></strong><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Here is the example, which I am working on:</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Highlights of the Report:</font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt &#39;Times New Roman&#39;">         </span></span><font size="3">Report is grouped on {Scenario Name}</font></font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt &#39;Times New Roman&#39;">         </span></span><font size="3">Left side dates on any of the tables is {Version Date}</font></font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt &#39;Times New Roman&#39;">         </span></span><font size="3">Dates on the top header on any of the tables is {Fsc Week End Dt}</font></font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt &#39;Times New Roman&#39;">         </span></span><font size="3">Other formulae used in this report are:</font></font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">1) = ({Query1.Demand Qty})/100000</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Numerical values displayed in the "Original values" table.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">2) =</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">if {Query1.Scenario Name} = &#39;DLYPRD:ASCP-PRD:PRD&#39; </font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">THEN mid ({Query1.Scenario Name},13,3)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">ELSE mid ({Query1.Scenario Name},13,6)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Second column with value PRD in any of the tables.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">3) {next qty} = if not onlastrecord then next({@ShortDemandQty}) else 0;</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">(used in the "next values vertically" table)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">4) - running total to calculate horizontally</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - For each record</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Version Date}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">5) - running total to calculate vertically.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - For each record</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Fsc Week End Dt}</font></p><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">In this report design, when I go and change the Sort order in the Record Sort Expert, some of the values go for a toss. I got two cases where the vertical values are correct in one case and horizontal values are correct in another case.</font></p><font face="Times New Roman" size="3"> </font><strong><font size="3"><font face="Times New Roman">First Case:</font></font></strong> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Cumulative vertical values are correct.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal">&#160;</p><font face="Times New Roman" size="3"> </font><strong><font size="3"><font face="Times New Roman">Second Case:</font></font></strong> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Cumulative horizontal values are correct.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal">&#160;</p><font face="Times New Roman" size="3"> </font><strong><span style="color: blue"><font size="3"><font face="Times New Roman">Is there any way to consistisize both the horizontal and vertical running totals. I even tried forcing the evaluate & reset like below and clearing the record sort order, but it did not work:</font></font></span></strong><strong><span style="color: blue"><font face="Times New Roman" size="3"> </font></span></strong> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">1) - running total to calculate horizontally</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - On change of field: {Fsc Week End Dt}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Version Date}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">2) - running total to calculate vertically.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - On change of field: {Version Date}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Fsc Week End Dt}</font></p><font face="Times New Roman" size="3"> </font><strong><span style="color: blue"><font size="3"><font face="Times New Roman">And one more observation on the running total, how it works in the crosstab is, the total runs likes a spiral rather than resetting at the column or row level. Is there any way to restrict this?</font></font></span></strong><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">3) {next qty} = if not onlastrecord then next({@ShortDemandQty}) else 0;</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">(used in the "next values vertically" table)</font></p><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">For example, onlastrecord does not seem to work on the "next values vertically" crosstab, rather brings the record from the next column.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">For 3/7/2007 - 01/APR/07, the value is 157.84 which is incorrect and should be 0.</font></p><strong><span style="color: blue"><font size="3"><font face="Times New Roman">I need to get a next on the running total. Next (fld) doesnot work for running totals. Please guide me, how to get the next values for the running total fields.</font></font></span></strong>

    Post Author: redtop6683
    CA Forum: Formula
    Whoops I guess I should have mentioned that I've already tried using Sum and Round(Running Total, 2) and haven't had any luck.
    I also should have mentioned that Groupings 1 and 2 are sums, and that Running Total is a running total that changes on every change of the grouping.  There are 4 groupings.
    Grouping 1 (Employee Name)
    Grouping 1.1 (Shift)
    Grouping 1.2.1 (Payroll Department Code)
    Grouping 1.2.1.1 (Description)
    Below these 4 groupings is where the running total is.  The issue is that in the footer of grouping 1 is a field that sums the elapsed hours for the particular employee by each payroll department code, these are then summed using the running total.  The issue is as stated in the earler post that I can round these individual sums on the groupings, but I get the number on my running total to round differently as you can see by the earlier post's example.
    Thanks for the help.
    ~Jason

  • Now and Next details not correct

    Seems that my box updated a couple of weeks ago and since then the now and next function doesn't work properly.
    Often the display states "No Info" or displays the incorrect time and program for what is actually being shown on the channel.
    Anyone else experiencing issues?

    I've noticed that as well in the last few days. It is usually slow to complete the info when changing channel and sometimes displays info that is just plain wrong. I wonder if it's a fault with the 7.1.7 version of the software?
    I also noticed that a few times I had paused a live program and then left it paused until after the program ended. Pressing info then gave no info at all. The box had got confused and given up.   Not sure if it does that every time.

  • The find box (previous and next) has just stopped functioning while I was reviewing a pdf file. How can I resurrect it?

    The find box (previous and next) has just stopped functioning while I was reviewing a pdf file. How can I resurrect it?

    [discussion moved to Creating, Editing & Exporting PDFs forum]

  • Page Functionality(Prev and Next) using applet

    Hi,
    I am trying to implement an applet which has the paging functionality(previous and next). How do I handle the mouse event for that.
    Appreciate your help.
    Thanks
    Sankar.

    ok. Sorry about that, Here is my applet implementation,
    public class PageApplet extends JApplet implements ActionListener,MouseListener
         JTextField name,age;
         JRadioButton male, female;
         static String maleStr = "Male";
         static String femaleStr = "Female";
    private boolean inAnApplet = true;
    JComboBox status;
         JPanel pane;
         GridBagConstraints c;
         private static int count =0;
         private String nameStr;
         public PageApplet() {
         this(true);
    public PageApplet(boolean inAnApplet) {
    this.inAnApplet = inAnApplet;
    if (inAnApplet) {
    getRootPane().putClientProperty("defeatSystemEventQueueCheck",
    Boolean.TRUE);
         * The entry point for the applet.
         public void init()
              setContentPane(makeContentPane());
         public Container makeContentPane() {
              //Add Components to a JPanel, using the default FlowLayout.
         pane = new JPanel(new GridBagLayout());
    c = new GridBagConstraints();
              c.fill = GridBagConstraints.HORIZONTAL;
    JLabel namel = new JLabel("Name : ",JLabel.LEFT);
              c.weightx = 0.6;
              c.gridx = 0;
              c.gridy = 0;
    pane.add(namel,c);
              name = new JTextField(20);
              name.setColumns(20);
              c.gridx = 5;
              c.gridy = 0;     
              name.addActionListener(this);
              pane.add(name,c);
    JLabel agel = new JLabel(" Age : ", JLabel.LEFT);
              c.gridx = 0;
              c.gridy = 1;
    pane.add(agel,c);
              age = new JTextField(2);
              age.setColumns(2);
              age.addActionListener(this);
              c.gridx = 5;
              c.gridy = 1;
    pane.add(age,c);
              JLabel gender = new JLabel(" Gender :", JLabel.LEFT);
              c.gridx = 0;
              c.gridy = 2;
    pane.add(gender,c);
              male = new JRadioButton(maleStr);
         male.setMnemonic(KeyEvent.VK_C);
         male.setActionCommand(maleStr);
              male.setSelected(true);
              male.setBackground(Color.WHITE);
              male.addActionListener(this);
              c.gridx = 5;
              c.gridy = 2;     
    pane.add(male,c);
    female = new JRadioButton(femaleStr);
    female.setMnemonic(KeyEvent.VK_D);
         female.setActionCommand(femaleStr);
         female.setBackground(Color.WHITE);
              female.addActionListener(this);
              c.gridx = 10;
              c.gridy = 2;
              pane.add(female,c);
              JLabel statusl = new JLabel(" Status :", JLabel.LEFT);
         c.gridx = 0;
              c.gridy = 3;
    pane.add(statusl,c);
              String[] statusStr = {"Single","Married","Divorced"};
              status = new JComboBox(statusStr);
              status.setSelectedIndex(0);
              status.setEditable(false);
              status.setBackground(Color.WHITE);
              status.addActionListener(this);
              c.gridx = 5;
              c.gridy = 3;
    pane.add(status,c);
    JButton next = new JButton("Next");
              c.ipady = 0;
              c.weightx=0.0;
              c.weighty=1.0;
              c.anchor = GridBagConstraints.SOUTH;
              c.insets = new Insets(10,0,0,0);
              c.gridwidth = 1;     
              c.gridx = 5;
              c.gridy = 4;
              next.addMouseListener(this);
              pane.add(next,c);
         //pane.setBackground(new Color(255,255,204));
         pane.setBackground(Color.WHITE);
              //pane.setLayout(new GridBagLayout(2,2));
         pane.setBorder(BorderFactory.createMatteBorder(1,1,2,2,Color.black));
    return pane;
         public Container makeContentPane1() {
              //pane = new JPanel(new GridBagLayout());
              pane.removeAll();
    c = new GridBagConstraints();
              JLabel label1 = new JLabel("Hello ",JLabel.RIGHT);
              c.gridx = 0;
              c.gridy = 0;
    pane.add(label1,c);
              JTextField text1 = new JTextField(20);
              text1.setText(nameStr);
              text1.setColumns(20);
              text1.setEditable(false);
              c.gridx = 5;
              c.gridy = 0;
    pane.add(label1,c);
              JButton finish = new JButton("Finish");
              finish.addMouseListener(this);
              c.anchor = GridBagConstraints.CENTER;
              c.insets = new Insets(10,0,0,0);
              c.gridwidth = 1;     
              c.gridx = 5;
              c.gridy = 2;
              pane.add(finish,c);
              //Add Components to a JPanel, using the default FlowLayout.
         // JPanel pane = new JPanel();
              // pane.add(label1);
              // pane.add(text1);
              // pane.add(finish);
         //pane.setBackground(new Color(255,255,204));
         pane.setBackground(Color.WHITE);     
         pane.setBorder(BorderFactory.createMatteBorder(1,1,2,2,Color.black));
    return pane;
         public void actionPerformed(ActionEvent e)
                   if (e.getActionCommand().equals(maleStr)) {
                   male.setSelected(true);
         female.setSelected(false);
              } else if(e.getActionCommand().equals(femaleStr)){
              male.setSelected(false);
         female.setSelected(true);
                   nameStr = name.getText();
                   JComboBox cb = (JComboBox)e.getSource();
                   String statusStr = (String)cb.getSelectedItem();
                   if(statusStr.equals("Single"))
                   status.setSelectedIndex(0);
                   else if(statusStr.equals("Married"))
                   status.setSelectedIndex(1);
                   else if(statusStr.equals("Divorced"))
                   status.setSelectedIndex(2);
              public void mousePressed(MouseEvent me){
              public void mouseClicked(MouseEvent me){
                   JButton next = (JButton)me.getSource();
                   String str = next.getName();
                   if(((me.getClickCount()==1)) || (str.equals(next))){
                   setContentPane(makeContentPane1());
                   count=1;
                   }else{
                   URL url;
                   try {
                   String nextPage="http://"+this.getCodeBase().getHost()+":"+this.getCodeBase().getPort()+"/ShowPage.jsp";
                        url=new URL(nextPage);
                        getAppletContext().showDocument(url);
                   }catch(MalformedURLException ex) {
                             ex.printStackTrace();
              public void mouseReleased(MouseEvent me){
              public void mouseEntered(MouseEvent me){
              public void mouseExited(MouseEvent me){
              private static void createAndShowGUI(){
              JFrame frame = new JFrame("Application version: AppletDemo");
              frame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
              System.exit(0);
         PageApplet applet = new TestPartner(false);
         if(count==1)
                   frame.setContentPane(applet.makeContentPane1());
         else
              frame.setContentPane(applet.makeContentPane());
         frame.pack();
         frame.setVisible(true);
              public static void main(String[] args) {
                   javax.swing.SwingUtilities.invokeLater(new Runnable() {
         public void run() {
              createAndShowGUI();
    Here is what I am trying to do, when the user hits the next button it should go to the next page. but when I hit the next page, its hanging in the same page. Since I am new to applet coding, I couldn't proceed.
    Thanks
    Sankar.

  • SSRS countrow Aggregate error(Aggregate and lookup functions cannot be used in query parameter expressions.)

    Below expression works fine with text box but gives error in dataset expression.
    ="SET FMTONLY OFF select  "+ join(Parameters!Column.Value,",") +" FROM pamcustom.dbo.vw_HFL_HFD_HotfileData INNER JOIN pamcustom.dbo.HFL_HFB_HotFileBatch  on BatchID = HFB_intBatchID where BatchID ="+Parameters!BatchId.Value+"
    and "+Parameters!cmbTranType.Value+" "+ iif(CountRows("DS_Aml_Mnr_Iss_Desc")=Parameters!Mnr_Iss_Desc.count," "," and aml_mnr_iss_desc in "+"('" & join(Parameters!Mnr_Iss_Desc.Value,"','")
    & "')")+iif(CountRows("ds_ReportingCategory")=Parameters!ReportingCategory.count," "," and ReportingCategory in "+"('" & join(Parameters!ReportingCategory.Value,"','") & "')")+iif(CountRows("ds_NAICSubGroup")=Parameters!NAICSubGroup.count,"
    "," and naicsubgroup in "+"('" & join(Parameters!NAICSubGroup.Value,"','") & "')")+iif(CountRows("ds_PortTrading")=Parameters!PortTrading.count," "," and porttrading in "+"('"
    & join(Parameters!PortTrading.Value,"','") & "')")+iif(CountRows("ds_GL_LE")=Parameters!GL_LE.count," "," and gl_le in "+"('" & join(Parameters!GL_LE.Value,"','") &
    "')")+iif(CountRows("ds_coagroup")=Parameters!cmbCoaGrp.count," "," and coagroup in "+"('" & join(Parameters!cmbCoaGrp.Value,"','") & "')")+iif(CountRows("Portfolio")=Parameters!cmbPort.count,"
    "," and portfolio in "+"('" & join(Parameters!cmbPort.Value,"','") & "')")+IIf(IsNothing(Parameters!txtSecID.Value)," "," and secid in ('"+Replace(Parameters!txtSecID.Value,",","','")+"')")+iif(IsNothing(Parameters!minPortFilter.Value)
    and IsNothing(Parameters!MinPort.Value)," "," and portfolio "+Parameters!minPortFilter.Value+Parameters!MinPort.Value)+iif(IsNothing(Parameters!maxPortFilter.Value) and IsNothing(Parameters!MaxPort.Value)," ","
    and portfolio "+Parameters!maxPortFilter.Value+Parameters!MaxPort.Value)+iif(IsNothing(Parameters!minCoaFilter.Value) and IsNothing(Parameters!txtMinCoa.Value)," "," and portfolio "+Parameters!minCoaFilter.Value+Parameters!txtMinCoa.Value)+iif(IsNothing(Parameters!maxCoaFilter.Value)
    and IsNothing(Parameters!txtMaxCoa.Value)," "," and portfolio "+Parameters!maxCoaFilter.Value+Parameters!txtMaxCoa.Value)
    I guess the error " Aggregate and lookup functions cannot be used in query parameter expressions." is because I am using CountRow to ensure that if all values of multi select all selected i will not use that filter in where clause.
    Pls. guide...

    Hi, Include your parameter total count in the dataset for parameter and instead of using countrows() function use the count from dataset in the expression.
    Hope this helps.........
    Ione

  • Previous Page and Next Page functions lost

    The Previous Page and Next Page icons suddenly vanished with only the Reload Page and Add Bookmark icons showing. The only way I am able to return to a previous page is through History. Will I have to reintall Safari? and, if so, can I just install Safari without jeopardizing my data not only in Safari but other applications? I have original OS X 10.2 and 10.3 discs. Can I reintall over the existing Safari app?
    Thanks much.
    TeddyZ
    G4   Mac OS X (10.4.3)  

    Sorry, but this didn't work at all. I think Safari has been corrupted and think I'll have to reinstall.
    Do I deinstall? or can I reinstall over the existing Safari? And can I isolate Safari with my existing OS discs (I have both OS 10.2 and 10.3.5)?
    I have an external hard drive. Could that be helpful in this process?
    (I suspect that all my bookmarks will be lost, but can compensate by printing them out in hard copy).
    G4   Mac OS X (10.4.3)  

  • Translate and next day function

    hi everybody, i am trying to learn how translate and next_day function works in oracle.
    i have the following query
    select translate(to_char(sysdate,'yyyy/mm/dd'), 'A0123456789','A') FROM DUAL;
    when i execute it, the result is //
    my question is why is that, i thought it suppose to be AAAA/AA/AA
    translate suppose to replace any character in the string 'A1234...' with A
    but this is not happening. can somebody explain how is this working?
    also i have this query
    select next_day(to_date('06/23/1998','mm/dd/yyyy'), 'friday') from dual;
    when i execute it, it gives me 6/26/98 which is a thursday and not a friday. again why is this?
    when i execute this query, select next_day(to_date('07/10/2000','mm/dd/yyyy'), 'friday') from dual;
    i get 7/14/2000 which is correct. any ideas on this?

    Hi,
    Whenever you have a question about a function, start by looking at the [SQL Language manual|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions204.htm#sthref2476].
    Under "Translate", the very first paragraph looks like it was written in response to your question:
    "TRANSLATE returns expr with all occurrences of each character in from_string replaced by its corresponding character in to_string. Characters in expr that are not in from_string are not replaced. The argument from_string can contain more characters than to_string. In this case, the extra characters at the end of from_string have no corresponding characters in to_string. If these extra characters appear in expr, then they are removed from the return value."
    I find it helpful to write the 3rd argument of TRANSLATE directly under the 2nd argument, to make it clear with what each character of the 2nd argument is being replaced:
    select  translate ( to_char (sysdate, 'yyyy/mm/dd')
                , 'A0123456789'
                , 'A'
    FROM      DUAL;makes it clear that (for example) '5' will be replaced with nothing (that is, removed) because there is nothing directly below '5'.
    On the other hand:
    select  translate ( to_char (sysdate, 'yyyy/mm/dd')
                , '0123456789'
                , 'AAAAAAAAAA'
    FROM      DUAL;makes it clear that '5' will be replaced with 'A', because there is an 'A' directly below '5'.
    Notice in the last example, there's no need to include 'A' in the 2nd argument.

  • Previous and next records in a table

    Let's say I have a table where I have
    item name sequence customer number
    I want to select these three fields where name = 'INSPECTION', but I'd also like to grab the record prior to this and the record after this, regardless of the name content. I need to do it for each customer number.
    Is it possible for a novice like me to do?
    Thank you

    What is "next record" and "previous record" for you in this context? A database table doesn't have records in any specific order. They have an arbitrary order.
    If for you, the records have the sequence as an ordering information, then you could use LAG and LEAD functions.

  • MacBook Pro battery had accumulated more than a 1000 charges, and stopped functioning unexpectedly. Went and got the battery replaced. Just saw that SMC Firmware 1.6 update deals with this. Possible to get my money back?

    MacBook Pro battery had accumulated more than a 1000 charges, and stopped functioning unexpectedly. Went and got the battery replaced. Just saw that SMC Firmware 1.6 update deals with this. Possible to get my money back?

    The firmware update corrects an error that may occur, however the techs would have checked the condition of the battery prior to installing a new one.  If the battery was questionable, the firmware update was really not too important.
    You can check the battery condition by going to the apple, left side of the menu bar, About This Mac, More Info, System Report, Hardware, Power and see what it says about Cycle Count, Condition, Capacity: Condition anything but Normal needs to be checked and may need to be replaced.
    The cycle count of 1,000 charge cycles is the typical life of a Lithium-Ion battery, the point at which the capacity drops to 80% of the as built capacity.

  • Mac OS X 10.5.1 - Disk Permission Verify and Repair Functions Are Broken

    Machine: Mac mini with 1.66 MHz Intel Core Duo,
    OS: Mac OS X Version 10.5.1
    Note: Upgraded to Leopard from version 10.4.10
    When using Disk Utility to attempt to verify or repair the permissions of the internal hard drive volume containing the OS, the progress meter stops moving and the verify or repair operation does not finish. The Console log file reveals the problem:
    Mac OS X Version 10.4.10 (Build 8R2218)
    2007-10-29 17:57:06 -0700
    2007-10-29 17:57:07.061 SystemUIServer[3402] lang is:en
    Oct 29 19:47:08 Mac3 diskarbitrationd[39]: loginwindow [3374]:12959 not responding.
    nvram: Error (-1) getting variable - 'boot-args'
    Can't access "efi-boot-device" NVRAM variable
    Can't access "efi-boot-device" NVRAM variable
    Can't access "efi-boot-device" NVRAM variable
    Note that the OS version is incorrectly reported as 10.4.10 in the console log. This was the version that I was using PRIOR to installing Leopard. The version I'm actually using is 10.5.1.

    After a second look, the console messages do not relate to the problem I reported. They relate to another lockup problem I'm having after moving from Tiger to Leopard.
    Nevertheless, the description of the problems I'm having with the Verify and Repair functions of the Disk Utility is accurate. I had absolutely no problems when I was using Tiger.

  • I'm trying to add prev and next button to a gallery

    I've found a free flash gallery which looks good for my need here: http://www.flashgallery.org/
    The only problem is that the gallery doesn't have prev and next buttons for the full size images, so I'm trying to add them.
    I've been able to add those buttons, but they only work if I don't click on a thumb, as I click on a thumb they stop working.
    In the code there is a function called loadGImage which loads the full size images, originally that function accepted 2 parameters, I've added a 3rd one which store the current image's index inside an array, so that I can use my buttons to call that function with index+1 for next and index-1 for prev.
    In addition to this I've added a variable which is updated everytime a full image is shown, that variable contains the image's index.
    Clicking on thumb the buttons stop working because the current image's index turns to "undefined" so they can't pass a correct value to loadGImage.
    I've checked the code of the gallery, but I can't find where is said to the thumbs to call loadGImage, if I'd found that code I could add the index parameter and my buttons would work.
    I'm sure that the thumbs call loadGImage because I've put a trace() inside the function to see when it is activated.
    Here you can find the source file of the gallery (plus some images to see how the gallery works)
    http://www.fileden.com/files/2008/4/9/1858524/FlashGallery2.rar
    The code commented using /*   */ is the code written by me.
    Can you help me to find where the thumbs make the call to loadGImage?

    The informations about the images are read from an XML file.
    These variables will contain the informations
    _root.description = new Array();
    _root.small_image = new Array();
    _root.big_image = new Array();
    _root.total_images = 0;
    This code creates the thumbs
    function createSmall()
        _root.smallContainer.createEmptyMovieClip("smallImageContainer", 10);
        var _loc4 = 0;
        var _loc3 = 0;
        for (var _loc2 = 0; _loc2 < _root.small_image.length; ++_loc2)
            _root.smallContainer.imageContainer.attachMovie("smallImage", "smallImage_" + _loc2, 100 + _loc2);
            m = _root.smallContainer.imageContainer["smallImage_" + _loc2];
            m._x = _loc3 * 50;
            m._y = 0;
            m.imageContainer.loadMovie(_root.small_image[_loc2], 100);
            m.iData = Array();
            m.iData.big = _root.big_image[_loc2];
            m.iData.title = _root.description[_loc2];
            ++_loc3;
        } // end of for
        _root.smallImageContainer._x = 5;
        _root.smallImageContainer._y = 0;
    } // End of the function
    And this is how full size images are loaded
    function loadGImage(title, bigImgURL)
        _root.bigImage.imageContainer.loadMovie(bigImgURL, 100);
        _root.bigImage.imageContainer._x = 0;
        _root.bigImage.imageContainer._y = 0;
        _root.title.text = title;
        //trace(bigImgURL);
    } // End of the function
    I've checked around the fla file, but I haven't found any code associated to the thumbs which says to call loadGImage, that's my problem, because the code itself is not hard to understand.

  • How to track the Back and Forword functiona on a JFrame

    We are Developing an Application with Java swings.In this we 've used some of the components and are JFrame,JPanel,SplitPane,JButtons and etc.
    In this we've used JButton for the Back and forword function as we have with the I.E.
    So the Problem is that
    when I click Back Button I need to get the Previous JFrame Contents and for Forword I need to get next JFrame Contents the Function are same as back and Forword Functions of Internet Explorer.
    I'tried with Undo() Package but I did not get the Required Output
    Thanks in Adv,

    How about the following:
    1. Creat a top level container (ie window) with menus,
    back/forward buttons etc. using whichever layout
    manager is appropriate.
    2. Create a panel, and add it to this window. Set the
    panel to use card layout manager.
    3. Display all output from your app in the panel, and
    let the window's back/forward buttons call the
    appropriate methods on the card layout manager.
    Thanks for reply,
    But i had done the same thing i.e icreated a top level(using JFrame) for the buttons menus and etc.
    then using the layouts manager.
    created a panel andused cardlayout manager but my problem is taht when i add those conetents(called panel contents of the frame) as component and add it this panel then i am geeting thaierror stating
    java.lang.IllegalArgumentException: adding a window to a container
    so that is the problem i.t it is not get added to the newpanel.

  • Previous and Next Record

    Is there any additional code needed to replicate the functionality of the previous and next record buttons in the standard toolbar other than the built-ins that are provided? I'm getting some weird results by just using the built-ins. Thanks!

    Well, to give you and example, when I query the first record and then press the button that uses the previous_record built-in I get the message: at first record (same as the toolbar button). However, when I press the next record button, I'll eventually get the message: field must be entered (whereas, the toolbar button will bring up the message: record must be entered or deleted first). I was wondering why the next_record built-in would bring up a different message, and how to get my button to function the same way as the one in the toolbar.

Maybe you are looking for

  • Can I Boot an iMAC i7 Mt Lion using Leopard?

    My 2009 iMAC 2.8 Intel Core Duo 24" 10.5.8 (Leopard) lost it's Fire Wire. (Long Story-my fault)  Shop told me it needs a logic board.  ($1400.-1500.00) Apple care is well over.  Otherwise the unit works well.  No wireless, no mobile devices.  Well as

  • Cant open PDF files. Cant open Adobe Reader x

    Hi, I am running windows xp pro. I am having trouble opening PDF files and I cant open adobe reader x. I have uninstalled several times and reinstalled. I have stoped all antivirus services.

  • PROBLEM WITH OUTLOOK

    GUYS FIX THIS OUTLOOK , IT DRIVERS ME CRAZY, I CANT SEND EMAIL.

  • Experiencing Issue with Beasvc.exe and Win2K on WLS6.0SP2

    I'm running into an issue with my cluster when I run my nodes as a background service on Win2K Advanced Server. Nodes are dropping out of the cluster left and right. There is no trace even in verbose mode that is telling me why my nodes are failing.

  • Inconsistent  Data for File Content Conversion

    HI XI Friends, Its IDOC to File Scanario, File is of .txt file.. my IDOC contains 14 segments some times some segements will not come with Idoc.. first three characters represent segment numbers.. structure of txt file 00112345       address1  street