How to manage the substitution variable / parameter in crystal

I have developed a Crystal report in BO XI. I have 2 parameters. These are date parameters.
I want to get parameters from the users.
The records will be selected for the date in the parameters field.
But if the date in the parameters are NULL then the record selection will be for the previous month.
Has anyone encountered this situation ??
Thanks in advance ..

From Crystal reports, I want to pass NULL value in the parameter as a DEFAULT.
I know its not possible, so I passed following date 01/01/1900 in both Date parameters as default.
Then in my select query I said -
select * from purchase
where
     paymentmethod ='Credit Card'
     and
          purchasedatetime >=
          Case {?PurchaseDateFrom}
          when TO_DATE('01/01/1900','dd/mm/yyyy') then SYSDATE-30
          Else {?PurchaseDateFrom}
          End
          and
          purchasedatetime <=
          Case {?PurchaseDateTo}
          when TO_DATE('01/01/1900','dd/mm/yyyy') then  SYSDATE+1
          Else {?PurchaseDateTo}
          End
The above query works fine.
But I want to try something like this - (pseudocode)
first I will check the parameter value :
Declare - myFromDate , myFromTo as variable
If {?PurchaseDateFrom} is null then myFromDate = SYSDATE-30
else myFromDate = {?PurchaseDateFrom}
if {?PurchaseDateTo} is null then myFromTo = SYSDATE+1
else myFromTo = {?PurchaseDateTo}
select * from purchase
where
     paymentmethod ='Credit Card'
     and
     purchasedatetime between myFromDate and myFromTo
Thanks,

Similar Messages

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • How to set the header variables in weblogic

    Hi,
    We have a following set up in our environment.
    We have weblogic and on the top of it we have apex listener deployed which redirects Oracle Apex.
    My Issue:
    How can we set up the header variables in weblogic once the user is authenticated against weblogic server.
    We are struck here, not knowing how to set the header variables in weblogic server. Its fairly straight forward for Oracle Access Manager or others..
    Thanks
    Ramesh P.

    maybe you are looking for the routing options
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageflow.html#wp1125348

  • How to get essbase substitution variable in ODI

    Hi All,
    I have a problem that I need to get the substitution variable from Essbase /EAS to work on some SQL statement in ODI.
    How can I do in ODI ???
    Thanks for all ..
    Thomas

    Hi,
    If you read my blog post :- http://john-goodwin.blogspot.com/2009/11/odi-series-planning-11113-enhancements.html
    In the post there is a section on retrieving essbase substitution variables and using them in ODI.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can i use substitution variable

    Hai All
    This is my sql statement
    SELECT (TO_DATE(TO_CHAR(Intime,'DD-MON-YYYY')||' '||
    TO_CHAR(0815,'0000'),'DD-MON-YYYY HH24:MI')-intime) * 24*60
    from dail_att where to_char(intime,'hh24mi') between 0700 and 0815 ;
    Here my table name called Dailyattendance
    Intime field is declared as Date Type
    So now i have hardcoded 0815 and now my intime is subtracted from this time so i can calculate the employee
    coming late so how can i use substitution variable here to give the value at run time
    Ie i need to give 0815 instead or any other time at runtime
    Thanks In advance
    Srikkanth.M

    Where exactly are you planing to use it? Is sqlplus or at any other front end?
    One way is to use below given SQL
    SELECT   (  TO_DATE (   TO_CHAR (intime, 'DD-MON-YYYY')
                         || ' '
                         || TO_CHAR (:TIME_VAR, '0000'),
                         'DD-MON-YYYY HH24:MI'
              - intime
           * 24
           * 60
      FROM dail_att
    WHERE TO_CHAR (intime, 'hh24mi') BETWEEN 0700 AND 0815;*009*
    Edited by: 009 on Apr 6, 2010 2:15 AM

  • How to use the bind variable in custom.pll

    Hi,
    How to use the bind variable in custom.pll.Its through error.
    any one gem me.
    very urgent.
    M.Soundrapandian.

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

  • Hi someone, I went to muse theme and browse widgets to find the toolbox 024 of google language translator, i saw the video explaining how to manage the widgets but now where can i found it to include it in my website because the french version of muse don

    Hi someone, I went to muse theme and browse widgets to find the toolbox 024 of google language translator, i saw the video explaining how to manage the widgets but now, where can i found it to include it in my website because the french version of muse don't have several free widgets for people like me who pay every month the application.Thanks

    I'm not aware of a free translator widget.
    I found these...
    Website Translator 
    Translator Widget  $6.99 for the widget
    Adobe Muse TB024 Widget | MuseThemes.com  $69/year Includes everything | I signed up for this and it's been well worth it, they have new themes & widgets every month.

  • Unable to execute the substitution variable in calc scripts in essbase 11.1

    Unable to execute the substitution variable in calc scripts in essbase 11.1.3
    FIX(&CURRVERSION,COLA)
    Unit=units*Listprice;
    dataexport "file" "," "E:\NEW.TXT";
    ENDFIX
    Error: 1200471 Error parsing formula for FIX STATEMENT (line 1): expression expected before [)]
    This is error it throws when executing the calculation script
    I wonder whether its a problem with substitution variable i want to know wat went wrong inside the fix statement
    I have created substitution variable use maxl
    Installed the essbase in custom manner and standlone mode nt register with the shared services ,
    Is this problem with the custom installation of essbase
    Regards
    shenna

    If you remove the substitution variable and replace it with the actual value (whatever that is), does the code work? That will tell you if the issue is around the substitution variable or not.
    John -- First you race Glenn, then you race me -- and you always win. :)
    Regards,
    Cameron Lackpour

  • Using a business rule to set the substitution variables

    Hi All,
    I am having issues with setting the value of Substitution variable from a Business rule.
    Any help would be appreciated.
    Thanks,
    Shakil

    Thanks for your response, John.
    I am trying to set the Substitution variable through a data form on which the Business rule is attached.
    The admin guide for Planning states that "You can set substitution variables on the Essbase server,
    application, or database level. The same substitution variable can exist on multiple levels;
    Planning uses the first one it finds as it searches in this order: 1) database 2) application 3)
    server." So I believe that it should be possible.
    Regards,
    Shakil

  • How to assign a Substitution variable dynamically?

    Hi All,
    I was trying to assign a substitution variable which should get data from the time period and should directly load into the substitution variable automatically.
    The process should be automated. so as to refrsh the substitution variable daily.
    Any comments are highly appreciated
    With Regrads
    Prads

    Sorry for the double-post, I didn't quite get that you wanted to read the Time Period dimension.
    Is that what you are trying to do? Get a list of the periods (usually these are pretty well known) and then find the latest one for a given member combination that has data and then set a substitution variable off of that?
    You can run reports (or DATAEXPORT calc command) to get data from MaxL.
    Or are you trying to do something else?
    Regards,
    Cameron Lackpour

  • How to set the path variable on Windows ME?

    I want to get a friend of mine to start using java the only problem is that we both dont know how to set the path variable in Windows ME. I cant seem to find any instructions on it for ME. So if someone could please tell me how or give me a llnk to directions for Windows ME. Thanks.

    Refer to the Installation Instructions for the package that you installed - I believe #5 if the instructions has the information. A link to the instructions is at the page you installed from.

  • How to combine the same variables from 2 queries in one webi report

    HI ALL,
    I created two BW queries/universe and put them into one web intelligence report. Both queries have the same mandatory variable. I combined the relevant dimensions but can't find how to combine the two variables, which resulted in pop-up for 2 variables.
    Any idea?

    Hey Dick Zheng,
    Just to close it,
    Instead of working on existing reports.
    Create new report(s) on top of these changed Universes(2).
    1. New WebI report on top of Univ1 (With Prompt)
    2. New WebI report on top of Univ2 (Without Prompt)
    If both are working as expected. Do follow below:
    1. Open any Report (just created in above steps)
    2. Edit Query
    3. Add Query
    4. Select another Universe
    5. Drag few objects
    6. Run Queries
    Now see it is working as expected or not.??
    Still any issues post here...,,
    Gracias...!!

  • How to pass the USER variable to RPD in 11g?

    I am trying to figure out how to pass the USER variable to the RPD in 11g.
    In 10g, I had define an intializtion block to store the USER variable and pass it to a statement that has to be executed before the query is executed.
    We use the Oracle VPD technology that allows to restrict data access. This is the statement that has to be executed before a query can run.
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER(:USER))) from dual
    That is the 10g version and it works fine.
    In 11g, I tried to use
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER('VALUEOF(NQ_SESSION.USER)')) from dual
    but this is not working.
    Any help?

    any ideas?

  • How to manage the files in Ipod?

    Hi everybody!
    I just bought a 80GB Ipod and I'm having a hard time figuring it out how to manage the files I've downloaded to it. I just sent a podcast to it but it doesn't appear it the Podcast folder. I have to search it in the entire list of files. Can someone tell me how I can manage these files?
    Thank you very much!

    Hi everybody!
    I just bought a 80GB Ipod and I'm having a hard time
    figuring it out how to manage the files I've
    downloaded to it. I just sent a podcast to it but it
    doesn't appear it the Podcast folder. I have to
    search it in the entire list of files. Can someone
    tell me how I can manage these files?
    Thank you very much!
    Use iTunes.

  • How to manage the memory in i pad

    how to manage the memory in i pad

    Use iTunes on your computer to store items that you want to save but are not needed on the iPad. Learn to sync and also learn how to do file transfers. Delete unneeded items from the iPad.
    When you connect your iPad to iTunes you will see a bar describing how much of your storage space is being used on your iPad. I always suggest leaving plenty of space open for the iOS and apps to operate.

Maybe you are looking for

  • Customer Master creation

    Hi, I have to create customers, but not sure if i should use FD01 or XD01.  We are not using the SD module, so does it make any difference about using either of the t-codes. And do we HAVE to create customers centrally first ( without assigning to an

  • Word document attachments garbled

    When I try to send a Word document to users outside of my ISP they come through as "noname" This does not happen with TextEdit files or with pdf files. It also doe snot happen when sending attachments to other users in my ISP (Road Runner). The folks

  • Dual Studio displays and midi timepiece setup

    I have a G5 dual 2.7 GHz - with a 22" studio display and am trying to setup a 17"studio display as a second monitor. I bought a DVI to ADC Adapter for the 17". But when i went to plug the USB cable in, found out that I don't have enough usb ports. Th

  • Messages in deliver queue

    Hello everybody: Is there any way to get the list of the messages that are in que deliver queue for a domain? With hoststatus I can know the number of active recipients, but it would be useful sometimes to get the MIDs of the messages to process them

  • Removing RAM from new Aluminum 24" iMac

    What's the best way to remove the RAM chips from the new aluminum 24" iMac? I had a leftover 256 MB chip that I installed for a total of 1.25 GB of RAM, but now I would like to go to 4 GB. The RAM is very snug in there, and I don't want to break or d