Date subtraction using parameters

I created a parameter that asks for a Date and another parameter that asks how many days before the Date should I go back and return the relevant records. It works great in Desktop but when I push out to the web thru Discoverer 4i it doesn't support the Date Arithmetic. The condition basically looks like this
DATE_COLUMN between TO_DATE(:DATE,'MM/DD/YYYY') - :NUMBER_OF_DAYS_SEARCH_BACK_TO and TO_DATE(:DATE,'MM/DD/YYYY')
Any ideas how this should be re-written to work in Discoverer 4i?

RichardODreamweaver wrote:
> What I would like to be able to do is make this
automated using a "now" less
> 180 days syntax.
Assuming that $row_recordset['LASTCHECK'] is a MySQL date
field, this
will do it:
if (strtotime($row_recordset['LASTCHECK']) < strtotime('-6
months')) {
// it's more than six months old
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • "Date / Date Time" type parameters in crystal reports 2008

    i am using parameters in crystal report to select records. one of the parameters is "From Date" of type Date Time.
    i mapped this parameter to a field "DateIn" of type smalldatetime in my sql table.
    Now, when i open the report it asks for "From Date" but b y default it sets the time to current time so i have to change it to 00:00:00 manually. i want it to show 00:00:00 by default. which means i don't want time here.
    For this if i select the datatype of parameter "From Date" as Date only then i am not able to map it to the "DateIn" field of the sql table.
    Please help me out of this.
    Edited by: rohit0825 on Jun 2, 2010 2:25 PM

    >
    Deepravs wrote:
    > Hi Rohit,
    >
    > Change the Parameter to Date Datatype and use this formula in the "Record Selection Formula " (Report Tab -> Selection Formulas -> Record)
    >
    > = CDateTime ({?From Date})
    >
    > Though the parameter is date datatype it converts to datetime datatype amd maps to the desired column.
    >
    >
    > Thanks,
    Great !!!
    this is working.
    i found another way, i changed the datatype of parameter to Date and click ok and everything was good, it doesn't require any conversion to date time.
    Thank You so much. All Points You.
    Edited by: rohit0825 on Jun 3, 2010 10:47 AM

  • Using parameters in a select query sometimes not working

    I use parameters throughout my code - usually without problem, but for some reason in one case it does not return a result. When I modify the querystring to contain the value instead of using parameters it works. Is it because I'm secting a clob? or is it because I'm using a 9i ODP.net dll against a 10g database? this is c# 2.0
    here's the source code that does not work for me - REQUEST_DATA is a clob:
        public String loadRequest(String PSRNumber)
            String returnVal = null;
            ConnectionStringSettings connectionInfo = System.Configuration.ConfigurationManager.ConnectionStrings["Scribe"];
            OracleConnection myConnection = new OracleConnection();
            String strSQL = "select PSR, REQUEST_DATA from stats.request where PSR = :PSR";
            try
                myConnection.ConnectionString = connectionInfo.ConnectionString;
                OracleCommand cmd = new OracleCommand(strSQL, myConnection);
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add("PSR", OracleDbType.Varchar2).Value = PSRNumber;
                myConnection.Open();
                OracleDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                    returnVal = dr.GetOracleString(dr.GetOrdinal("REQUEST_DATA")).ToString();
                else
                    returnVal = null;
                dr.Dispose();
                cmd.Dispose();
            catch (OracleException ex)
                printError(ex.Message);
            finally
                myConnection.Close();
                myConnection.Dispose();
            return returnVal;
        }when I replace the line generating the sql, and remove the lines pertaining to parameters it works:
    String strSQL = String.Format("select PSR, REQUEST_DATA from stats.request where PSR = {0}", PSRNumber);
    I'm fine just using this as a workaround, but I need an explanation why the other does not work - I prefer to use parameters.
    Message was edited by:
    user633546

    I figured it out. thank you for your help in pointing me in the right direction.
    the problem was there was a trailing space in the data.
    when the data for that table is numeric for every record, the query allows me to leave out the single quotes. Trailing spaces do not seem to cause the database to see it as non-numeric - leaving out the quote still finds the record even if there is a trailing space.
    but when I put in the quote, it is not an exact string match, so it could not find the record. sometimes this flexibility gets me into trouble :\

  • How to use parameterized statements with labSQL?

    Hi everybody,
    I have a big problem with labSQL. Every statement or query I have to use in my program works correctly, but I have a performance problem when writing my data to the database. The problem is the handling of the SQL statements by the DB. The solution will be the use of parameterized statements with labSQL.
    The manual for NI Labview Database Connectivity Toolkit provides such information, but there are large differences to labSQL, and I don't get the clue. Is anybody able and would be so kind to help me? If someone has an example for using parameterized SQL statements with labSQL or the ADO methods for such stuff, please be so kind to share it with me.
    Thank you for reading all of this
    Best regards,
    Matthias

    Thank you very much for your help. I already had set up the correct SQL statement and created the parameters but got errors when executing the command object. After some tries I found that neither the SQL statement nor the parameters were the source of the error, as I had expected first.
    The problem was that I was sending the wrong data type to the execute method of the command object. It expected some variant input for the parameters. I send an array of strings, which caused an error. I casted that array to variant with the same result. But a single string to variant worked well (with only one parameter in the SQL statement). The easy solution was to cast all strings to variants, and then build an array out of them. The execute method worked with that. Now the transaction is 4 times faster than before 
    Thanks again!
    Edit:
    If someone is interested in some example VI, please let me know. I should have some time next week to build one.
    Message Edited by manicnobody on 02-26-2009 10:19 AM

  • Adding Standard Text to the Selection Screen obtained using PARAMETERS

    Hi all,
    I have a report program which has the selection screen declared by the key word PARAMETERS.
    Now I need to make the changes to this program such that a Text Editor appears on the Selection Screen and has a Standard text that should be displayed.
    How can I do it?
    I saw the screen number of the Selection Screen and went to screen painter and tried to add the Text Editot..but it did not let me dou2026.Why?
    How should I add a standard text to a selection screen? The standard text should not be on top , but some where on the screen.
    Regards,
    Jessica Sam

    Hi Sam,
    I dont want to create a new screen for this. On the existing screen whihc was built using PARAMETERS key word..i should insert a blokc of text whihc is mpre than 5-6 lines..how should i do it.
    I navigated to Text Elements---->Selection Texts
    it is now asking for Name and Text and i see in Name column the name of the parametsr that they used for Check box, radio button etc and in Text i see the text that is appearing on the screen
    Now i am not sure what is should do next
    My req is..i should display a block of standard text that doesnt change and whihc is of 4-6 lines?
    how should i do it?
    please also help me with what data declartions that i should do in parametrs key word in program?
    Regards,
    Jessica Sam

  • Export Jasper Report Through JSP(using parameters)

    Hi All ;
    Please I need A help ;
    I need to use a Jasper Report in my jsp pages using parameters ;
    can some one tell me how i can do it by steps & with example ;
    note that i use Oracle Data Base;
    Regards;

    I would start off reading a JasperReports tutorial.
    Here is a list of all JasperReports tutorials available on the world wide web:
    http://www.google.com/search?q=jasperreports+tutorial

  • Generic data extractor using a function module

    Hi All,
    I want to create a generic data extractor using a function module within the BW system. i.e. the extractor will run in BW and and store the data in a cube( in BW). No R/3 is invloved. I proceeded as follows:
    1. Created a structure through se11.
    2. Created a function module. But while defining "E_T_DATA" in the "Tables" section of the function module, I am getting the error "TABLES parameters are obsolete". I defined as follows:
    E_T_DATA TYPE ZBW_EXTRACT 
    ZBW_EXTRACT is the name of the structure.
    What should i do in this case ?
    Thanks,
    Satya

    Hello Satya,
    The message "TABLES parameters are obsolete" is just a warning and not an error. The structure of the interface is strict (defined by SAP). You should opt to proceed even if you receive the warning.
    Hope this clarifies.

  • Generic data extractor using function module

    Hi All,
    I want to create a generic data extractor using a function module within the BW system. i.e. the extractor will run in BW and and store the data in a cube( in BW). No R/3 is invloved. I proceeded as follows:
    1. Created a structure through se11.
    2. Created a function module. But while defining "E_T_DATA" in the "Tables" section of the function module, I am getting the error "TABLES parameters are obsolete". I defined as follows:
    E_T_DATA TYPE ZBW_EXTRACT
    ZBW_EXTRACT is the name of the structure.
    What should i do in this case ?
    Thanks,
    Satya

    Hi,
    I went to se80. Copied the function module "RSAX_BIW_GET_DATA_SIMPLE" to my function group. When i tried to change the associated type from "SFLIGHT" to my own structure, it again gives a warning that "TABLES parameters are obsolete!". It does not allow me to either save, check or activate the function module. What should i do ?
    Please reply urgently.
    Thanks,
    Satya

  • Date Subtraction

    I am trying to figure out a way to subtract dates to get age. If I were to enter my birthdate, I would like to calculate the age. I know how to get today's date but how does one due date subtractions?

    Oh goody! One of my favourite topics again!
    Beware of using getTimeInMillis() for date subtractions, because java doesn't always return the same number of milliseconds per day. Quite apart from the valid point that on days that daylight saving occurs you lose or gain an hour, there seems to be a difference of a few (up to 8) milliseconds from day to day. Don't ask me why - there just is! This is fine as long as you use floating point maths to divide the time difference in millis by the (theoretical) number of milliseconds per day, but if you use integer maths, you're likely to get problems. Also, as I just pointed out, daylight saving time needs to be taken into account.
    It's better to avoid using time-related functions and work purely from the Calendar class. I won't post the full code of my date difference method, because I don't have it on this computer, but basically, you need to look at things like getActualMaximum(int field) in the Calendar class to get the number of days in a month or year.
    If your days are in the same month, it's simple.
    If your days are in different months of the same year, add together the number of days remaining in the month of the first date, the lengths of all the months in between, and the day of the month in the second date.
    If your dates are in different years, use the day number in the year (I can't remember the Calendar field name - look it up), then add together the number of days remaining in the first year, the number of days in the intervening years, and the day number in the second year. I'm assuming the dates are not too far apart!
    You could do something clever with calculating the number of leap years between the two dates, but I was trying to be extremely general, rather than assuming the Gregorian calendar.
    I hope I haven't complicated things too much!
    Robin

  • Data Subsetting using MDW

    I am using Mobile Data Workbench to create data publications for users on win32 laptops.
    While creating publication items, I would like to use parameters whose values I would like to specify using some variables, instead of manually keying them in for each user. Is there some way that I can specify the user name as the value for the parameter? Then I can use the same publication for multiple users and the data subsetting is done by the variable which gets its value dynamically from the user name to whom it is published.
    Thanks for your replies

    I have not done this with MDW as such, but to include user based data subserring do the following
    1) work out how you are going to identify the records for a particular user for the publication items in question. I know this sounds a bit obvious, but it is worth giving this some thought. Is the data directly in the table/view the publication item is based on? do you need to include some subselect to obtain the correct values (consider building a database view to help with this)? are the columns and joins all indexed (otherwise you will have performance problems in the compose process/download)
    2) the basic template given by the system for a publication item is 'SELECT * FROM <schema_owner>.TABLE' change this to something like one of the following (dependant on circumstance)
    'SELECT * FROM <schema_owner>.TABLE where USER=:user'
    'SELECT * FROM <schema_owner>.TABLE where ID IN (select id from <schema_owner.view where USER=:user)'
    'SELECT t.* FROM <schema_owner>.TABLE t, <schema_owner>.TABLE2 t2 where t1.ID=t2.ID and t2.USER=:user'
    all of these will work.
    NOTE <schema_owner> is needed for ALL objects included in the template
    NOTE the colon (:) used to identify the bind variable
    3) publish the new/altered publication items, and you will find in the mobile manager that under the users>applications tab, there will be a link in the data subsetting tab (probably called the oracle lite client type). click on this and you will get a screen with all of the bind variables you have defined for the application, with a place to add in the values for that user.
    Couple of points
    a) all bind variables (or data subsetting parameters) are held and tested as VARCHAR2. If you are matching to numerics in the base tables, do 'where ID=TO_NUMBER(:user)' otherwise you will get typecasting and this will affect your performance
    b) run conspef on the resultant publication items and check all parts for performance. The apply process uses the publication item priimary key for its selection, whilst the compose uses the selection criteria. You may need to tune for both options
    c) you can include multiple subsetting parameters for an application, but this may give more of a maintenance overhead
    d) the subsetting parameters are part of the application. If you have two or more applications being used by a user, you will have to include them in each
    e) the subsetting parameters can be included in the user setup ini script run by wsh as well
    [DATABASE]
    TYPE=ORACLE
    [USER]
    NAME=NBURROWS
    PASSWORD=NBURROWS
    ENCRYPTED=FALSE
    FULLNAME=NBURROWS
    PRIVILEGE=C
    [USER]
    NAME=CTOMKINSON
    PASSWORD=CTOMKINSON
    ENCRYPTED=FALSE
    FULLNAME=CTOMKINSON
    PRIVILEGE=C
    [ACL]
    APPLICATION=/fusionbci
    ROLE=DEFAULT ROLE
    USER=NBURROWS
    ACCESS=ENABLED
    ROLE=DEFAULT ROLE
    USER=CTOMKINSON
    ACCESS=ENABLED
    [SNAPSHOTVAR]
    NAME=V_PDA_FBS_SITE_DRIVER
    PLATFORM=WIN32
    VIRTUALPATH=/fusionbci
    USER=NBURROWS
    VAR=BI_ID,124547
    USER=CTOMKINSON
    VAR=BI_ID,119489

  • Use parameters in the folder

    I am new to Discoverer, so please excuse me if this is a dumb question.
    Right now, we have a table that is populated through a load procedure that runs at night. This is a kill-and-fill process which just runs a SELECT statement and inserts the results into a table. Many rows are created from this.
    The Discoverer report I am looking at just queries the table for the data using parameters. Simple and easy.
    However, I would really like to eliminate the load procedure all together and just use a pipeline function which gets the same information... and faster.
    I would like to change the SQL statement being used now to the one using the pipeline function. In order to do this, I would need to pass in the parameters from the report into the SQL statement (date range and other things).
    Is this possible?
    I appreciate everyones time to read this.

    Hi,
    There are two techniques you can use to pass parameters through to the table function that is referenced in a view mapped into the EUL.
    1. Join your table function to a table. For example, if you want to pass EMPNO into your table function then you can create your view like this:
    CREATE OR REPLACE VIEW pipedview AS
    SELECT e.empno, t.*
    FROM emp e, TABLE(your_function(e.empno)) tThen you can create a empno parameter based on the empno column in the view. This method only works if you have a tightly controlled list of values for your parameters.
    2. Use database contexts. Define a database context namespace and use a separate worksheet to set the database contexts. Check out some of these threads on how to use contexts with Discoverer:
    Re: Implementing HR report in Discoverer
    Re: Passing multiple parameters into Custom Folder...
    Re: Parameters in SubQuery
    Re: Passing Parameters to a discoverer folder using Note 282249.1
    Then create your view like this:
    CREATE OR REPLACE VIEW pipedview AS
    SELECT * FROM TABLE(your_function(SYS_CONTEXT('DISCO_CONTEXT','EMPNO'))) tYour users will have to ensure that the context has been set before the reporting worksheet is run.
    Rod West

  • Reload / Refresh JSP without using parameters

    Hi,
    I have a servlet, which gets data from a mobile phone and puts the data into a database.
    Then I have a Java Beans that takes data from the database. But I dont pass it with the
    request and response parameters.
    I just use the data like you see below, I use the object of the Java Beans mybean. In
    its constructor I do all the stuffs to read data from database.
    <jsp:useBean     id   = "mybean"   scope    = "session" class = "org.myHalloGMap.handler.Handler" />
    <jsp:setProperty name = "mybean"   property = "*" />The data I use like this:
    <%                                  
         for(int i=0;i<mybean.row_count_coordinates;i++){
                  if(mybean.getUsrn().equals(mybean.coordArrUsername)){
    row_count++;
    So my problem is now:
    How can I refresh my jsp, so that I can display the data, i read out of my database?
    When I use the webapplication and put new data into the database, on my webapplication
    is still shown without the new data. When I refresh the browser, it still shows me without
    new data?
    Can someone help me?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Perhaps the bean should be set to the request scope, since you use the constructor to read all the data from the database. When you use the:
    <jsp:useBean     id   = "mybean"   scope    = "session" class = "org.myHalloGMap.handler.Handler" />You will only create a mybean instance if one doesn't exist. When you first visit to the page the session is new, so you will create the mybean instance. After that, the mybean instance is found in the session so a new one isn't made - which means the constructor isn't called, which means no new data is read.
    If you put it in the request scope then the mybean instance will be re-made each request.

  • Error while Driving a view using parameters from other view

    Hi,
    I have created a report with streamlist and Barchart view.Driving option is used in streamlist to drive the barchart. The driving works well untill i dont use any filters in the Streamlist.Once i use parameters in streamlist , the driving works only for the default values set.When Second set of values are chosed for the parameter,the values are displayed correctly , but once they are selected for driving,the current values are replaced by the results of the default parameter settings.
    I have already done the tutorials for driving and it worked well untill i use filters in the main view,from where the driving is done.
    I would really appreciate if someone could give a solution for this problem.
    Regards,
    Lathika

    Hi,
    Login as i.e. sys as sysdba. Standard password is change_on_install.
    Or you can login in using user that has CREATE VIEW WITH ADMIN OPTION and then grant CREATE VIEW privilege to user to want.
    Peter D.

  • Issue in Data transfers using ALE for E-Recruiting standalone system

    Dear Experts,
    We have an issue in data transfers using ALE. We are having standalone system where E-Recruiting is maintaind seperately and the version is EHP5.
    When we configured iDoc in Sandbox and its working fine. But when it comes to Dev and Quality servers this is not working fine.
    we have created iDocs using the following filters.
    For Object P: Infotypes 0000, 0001, 0002, 0003, 0006, 0024, 0105.
    For Objects O,S: 1032, Subtype: 0010
    For Object: 1001, Subtype: A003, A008, A012, B007
    For Object O: 1001, Subtype: A002, B002, B003, B012, Tyoe of related object: O,S
    For Objects: C, O, S, Subtype: 1000, 1002, 1028
    For Object:C, Subtype: 1001, Subtype: A007
    When we do the data transfers in Sandbox using PFAL it is transferring the data properly.
    But when we do the same iin Dev and Quality servers we are not able to do it and gettign 52, 51 errors.
    Here we are facing a strange issue. For some Users when we transfer data it is transferring data but with 52 error messgae.
    For some users I am getting 51 error where i could not transfer any data.
    For some users, when we tranfer O, S, and P related data is moving but getting mostly 52 error and all the relationships are not moving here for O,S and properly. But P related CP, BP and NA are getting created successfully.
    It is happening only in Dev and Quality server and that too some users are able to get transferred but not all.
    Where will be the issue? How can we resolve this?
    Any help will be appreciable.
    Thank you in advance.

    Hi Sekhar,
    Have a look over these threads.
    Errors in ALE data transfer to E-Recruiting.
    http://scn.sap.com/thread/1535402    
    BR,
    RAM.

Maybe you are looking for

  • I am at capacity How can I free up space but not delete music

    My Ipad is at 55.4 gb used 24 gb in music alone. 2.7 gb available so can't do anything  Ipad shuts itself down and won't let me open mail, use facebook, safari.How can I free up space but not delete songs in library   

  • Long / Chained Clips Break CS6

    So, we've been trying to figure out what is causing the problems with mutlitple clips / multicam and the 'video not playing' problem. It looks like it's a problem caused by chained clips (where AVCHD and Canon XF files are joined on import because th

  • How do I get face time on my phone when visiting from dubai?

    how do I get face time on my phone when visiting from dubai?

  • Blocking an item in SO created by a PO via EDI

    Hello experts, i am in a SAP R/3 Release 4.6C, working with EDIs and there is this problem i can't fix. We create a PO via Edi and the system creates a SO from it. The ORDCHG is also configured properly and the changes go fine. The problem is when we

  • SAP -PP CONFIRMATION TIME

    Hi, i have created the order now while confirmation through cor6n the posting date is current date but the time is taling as 00.00.00 for execution start & there after execution finish time is calculated as per routing. i need the time for execution