Default date parameters with timestamps

Hi everyone!
I have an user request that I thought should be fairly simple, but I cannot quite get it working.
We have a concurrent request with beginning and ending date parameters. The users have requested that these dates default to the beginning/end of the current day.
For example:
20-MAR-2009 00:00:00
20-MAR-2009 23:59:59
I thought this would be a simple sql statement, but Apps does not seem to agree.
The parameters are of type FND_STANDARD_DATE.
What we have tried:
select to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01' p_beg_date
, to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59' p_end_date
from dual
-- did not work, said looking for DATE format --
select to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE
, to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE
from dual
-- works for beg date, but not end date, both display time as 00:00:01 ( I believe i was having issues in TOAD trying to get it as 00:00:00) --
Any ideas?
Thanks!
Janel
(apologies for the double post - what exactly is the difference between the 2 EBS forums?!?!?)

Your second code snippet is correct - it works in my instance :-)
SQL> alter session set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> select to_date(to_char(sysdate, 'DD-MON-YYYY') || '00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE,
  2  to_date(to_char(sysdate, 'DD-MON-YYYY') || '23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE from dual;
P_BEG_DATE                 P_END_DATE
20-MAR-2009 00:00:01       20-MAR-2009 23:59:59HTH
Srini

Similar Messages

  • Defaulting Date Parameters

    Post Author: tegage
    CA Forum: Formula
    I have many reports that allow the user to specifiy a starting and ending date range.  I would like the reports to default to all dates.  I can do this by defaulting the start date to "01-01-2000" and the end date to "12-31-2099", but then the calendar tool is useless since there is no TODAY button on the calendar tool and it picks up the default date, i.e., the users will have to do a lot of scrolling through the calendar tool.
    The other way is to make the starting and ending date parameters strings and use values like Today, This Week, This Month,....  and reolve them in the record selection formula.   This would be nice, but then if the user wants a specific date range, they don't have the calendar tool to use.
    Is there a way to take advange of the user-friendliness of string values and still have the calendar tool to use?

    Post Author: tegage
    CA Forum: Formula
    Thanks much for the response. 
    I had done exactly what you described - I had a string parameter for Today, This Week, etc and a set of date parameters - Starting and Ending Date.  But, in order to use the Starting and Ending dates in a formula, I had to provide them a default value - leaving them blank causes the record selection formula to explode.  The issue here is that the calendar tool picks up the default value instead of showing today's date. 
    I did more web surfing and found the answer on the Business Objects web site.  The solution let me do what you suggested AND keep the Starting and Ending date parameters as Date types and defaulted to blank by making them optional parameters.
    From the Business Objects web site (why isn't this stuff in the user's guide?):
    2.  Control over default values.
    3.  Request for an 'ALL' value.
    Both of requirements 2 and 3 are met with the new optional parameter feature of CR 2008.  When a parameter is flagged as 'optional', the report can execute without that value being set.  The trick here is that any formula that attempts to reference an optional parameters that doesn't have a value set will return an error.  So we've introduced the new HasValue() function which allows you to check and see if the parameter has a value. 
    This is really powerful, because now you can reference your parameters indirectly through another formula (or custom function) that checks if the parameter has a value or not.  If it does, then the formula returns the parameter value.  If it doesn't, then it can return whatever default value you wish.  So if you want the default to be the day before, or last Friday, then you can code that logic into your formula that uses HasValue to check if the parameter has a value set or not.
    Optional parameters were also intended to solve the 'All' problem.  Basically, you want a parameter to participate in a record selection formula only if it has a value.  If it doesn't, then you want that filter to be disabled.  By using optional parameters and HasValue() in your record selection (and new saved data section) formulas, you can include conditions in your filter only if the parameters in those conditions have a value.

  • Default date parameters to trunc(sysdate,'IW') in BI Pub Reports 11G

    Hi All,
    I have a requirement to default the date parameters in the BI Pub Report to the following when the reprot is scheduled to run.
    Start Date - Trunc(sysdate,'IW') - 8
    End date - Trunc(sysdate,'IW') - 2
    Steps followed:
    1. I have created 2 Date parameters in the data model as :P_START_DATE and :P_END_DATE.
    2. Created one data set with the query select Trunc(sysdate,'IW') - 8 "P_START_DATE" ,                                 Trunc(sysdate,'IW') - 2   "P_END_DATE
    I have used the same names for the dates so that they are referenced, but its not working as expected.
    Is there any other step i need to follow so that when i run the report from the dashboard, these default values populate which should be editable also.
    Can anyone please help.
    Thanks &Regards
    Geetha

    Hi Neeraj
    Not null parameters are not supported in the current release. All you could do it either default a value in there for the user - check the doc for details. Or drop a msg into the report if that value was null and not return any data. The second is not great I admit :0)
    Tim

  • Default date parameters

    Hi everyone!
    I have an user request that I thought should be fairly simple, but I cannot quite get it working.
    We have a concurrent request with beginning and ending date parameters. The users have requested that these dates default to the beginning/end of the current day.
    For example:
    20-MAR-2009 00:00:00
    20-MAR-2009 23:59:59
    I thought this would be a simple sql statement, but Apps does not seem to agree.
    The parameters are of type FND_STANDARD_DATE.
    What we have tried:
    select to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01' p_beg_date
    , to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59' p_end_date
    from dual
    -- did not work, said looking for DATE format --
    select to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE
    , to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE
    from dual
    -- works for beg date, but not end date, both display time as 00:00:01 ( I believe i was having issues in TOAD trying to get it as 00:00:00) --
    Any ideas?
    Thanks!
    Janel

    Thank you amox!!
    This gives me 3/20/2009 12:00:24 AM for p_beg_date and 3/20/2009 11:59:36 PM for p_end_date.
    Do you think there is anyway to get the seconds to be 00 for p_beg_date and 59 for p_end_date?
    Also, the concurrent program parameters are actually FND_STANDARD_DATETIME, not FND_STANDARD_DATE as I thought earlier.
    Thanks,
    Janel

  • Default Date Parameters for SSRS Subscription

    I have a SSRS 2008 R2 report running on a Sharepoint 2010 site.
    It has two date parameters (Beginning and Ending Date).
    The defaults of these dates are calculated correctly when running interactively.
    For example:
    =DateAdd("d",-28, Today)
    =DateAdd("d",-1, Today)
    However, when you create a subscription the defaults are based on when the report is submitted and not when the report is executed.
    Is there anyway to set a subscription to pull the default parameters every time when executed.
    Thanks in advance.

    Hi miguelh,
    Based on my research, if we specified the report parameters with “Use Report Default Value” is checked in the subscription, we could get the report from this subscription with the default value. The default values are based on the expression when the subscription
    is executed, rather than the time when we create the subscription. If today is 7/21/2014, the Beginning Date is 6/23/2014, Ending Date is 7/20/2014.
    So, please double check you have typed the expressions as the default values in the two date parameters and we have select the “Use Report Default Value” as the parameter values when creating the subscription .
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Date parameters with Sage

    I am attempting to build a report for SSRS using Visual Studio. 
    I have a query that is returning results, and the report is functioning perfectly.  However, the end user decided they wanted a date range selector on this report.  I have done this hundreds of times before with standard SQL databases/reports,
    but never before when accessing a Sage database.
    Here is my issue.  When I put the date parameters into the query, it throws an error message.  Here is the line in the query that is causing me the issue:
    AND SO_SalesOrderDetail.PromiseDate between {d @beginDate} and {d @endDate}
    And here is the error message it gives:
    Error[37000][ProvideX][ODBC Driver]Expected lexical element not found: <identifier>.
    This query functions perfectly if I hard code a static date into it, but the user wants to be able to select a date range of their own.  Any ideas on how to fix this issue?
    Mitchell Colwell

    Hi Wedge47,
    Based on your description, you are experiencing the problem when adding date range selector on this report by creating two parameters: BeginDate and EndDate, but when added them in the query, it caused some error, right?
    In SQL Server Reporting Service, there are two methods to filter the data by using a parameter, one is add it to the query, another one is add a filter to your dataset. I have tested on my local environment, the problem due the query is incorrect by using
    “{d @Date}” , so in order to avoid this issue, you can choose another method by adding a filter to create the date range selector:
    You can check steps below to know how to add the filter:
    Right click the main dataset to select the “Dataset Properties” and choose the filter on the left pane
    Click “Add” and add the filter: In the Expression choose the field of the date: PromiseDate
    Please refer to the article about the Transact-SQL Statements for the timestamp and date:
    http://msdn.microsoft.com/en-us/library/ms191307.aspx
    If you still have any question, please feel free to ask.
    Regards
    Vicky Liu

  • Overloading a DATE function with TIMESTAMP to avoid "too many declarations"

    CREATE OR REPLACE PACKAGE util
    AS
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR;
      FUNCTION is_same(a varchar2, b varchar2)
        RETURN BOOLEAN;
      FUNCTION is_same(a date, b date)
        RETURN BOOLEAN;
      /* Oracle's documentation says that you cannot overload subprograms
       * that have the same type family for the arguments.  But,
       * apparently timestamp and date are in different type families,
       * even though Oracle's documentation says they are in the same one.
       * If we don't create a specific overloaded function for timestamp,
       * and for timestamp with time zone, we get "too many declarations
       * of is_same match" when we try to call is_same for timestamps.
      FUNCTION is_same(a timestamp, b timestamp)
        RETURN BOOLEAN;
      FUNCTION is_same(a timestamp with time zone, b timestamp with time zone)
        RETURN BOOLEAN;
      /* These two do indeed cause problems, although there are no errors when we compile the package.  Why no errors here? */
      FUNCTION is_same(a integer, b integer) return boolean;
      FUNCTION is_same(a real, b real) return boolean;
    END util;
    CREATE OR REPLACE PACKAGE BODY util
    AS
         NAME: yn
         PURPOSE: pass in a boolean, get back a Y or N
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR
      IS
      BEGIN
        IF bool
        THEN
          RETURN 'Y';
        END IF;
        RETURN 'N';
      END yn;
         NAME: is_same
         PURPOSE: pass in two values, get back a boolean indicating whether they are
                  the same.  Two nulls = true with this function.
      FUNCTION is_same(a in varchar2, b in varchar2)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in date, b in date)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp, b in timestamp)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp with time zone, b in timestamp with time zone)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      /* Don't bother to fully implement these two, as they'll just cause errors at run time anyway */
      FUNCTION is_same(a integer, b integer) return boolean is begin return false; end;
      FUNCTION is_same(a real, b real) return boolean is begin return false; end;
    END util;
    declare
    d1 date := timestamp '2011-02-15 13:14:15';
    d2 date;
    t timestamp := timestamp '2011-02-15 13:14:15';
    t2 timestamp;
    a varchar2(10);
    n real := 1;
    n2 real;
    begin
    dbms_output.put_line('dates');
    dbms_output.put_line(util.yn(util.is_same(d2,d2) ));
    dbms_output.put_line(util.yn(util.is_same(d1,d2) ));
    dbms_output.put_line('timestamps'); -- why don't these throw exception?
    dbms_output.put_line(util.yn(util.is_same(t2,t2) ));
    dbms_output.put_line(util.yn(util.is_same(t,t2) ));
    dbms_output.put_line('varchars');
    dbms_output.put_line(util.yn(util.is_same(a,a)));
    dbms_output.put_line(util.yn(util.is_same(a,'a')));
    dbms_output.put_line('numbers');
    -- dbms_output.put_line(util.yn(util.is_same(n,n2))); -- this would throw an exception
    end;
    /Originally, I had just the one function with VARCHAR2 arguments. This failed to work properly because when dates were passed in, the automatic conversion to VARCHAR2 was dropping the timestamp. So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me, so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs. Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    Lastly, just for grins, I created the two number functions, one with NUMBER, the other with REAL, and even these are allowed - they compile. But then at run time, it fails. I'm really confused.
    Here is the apparently incorrect Oracle documentation on the matter: http://docs.oracle.com/cd/B12037_01/appdev.101/b10807/08_subs.htm (see overloading subprogram names), and here are the various types and their families: http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/predefined.htm.
    Edited by: hotwater on Jan 9, 2013 3:38 PM
    Edited by: hotwater on Jan 9, 2013 3:46 PM

    >
    So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me
    >
    That is because when you pass a TIMESTAMP Oracle cannot determine whether to implicitly convert it to VARCHAR2 and use your first function or implicitly convert it to DATE and use your second function. Hence the 'too many declarations' exist error.
    >
    , so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs.
    >
    Possibly because of another 'too many declarations' error? Because now there would be THREE possible implicit conversions that could be done.
    >
    Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    >
    I think the documentation, for the 'date' family, is wrong as you suggest. For INTEGER and REAL the issue is that those are ANSI data types and are really the same Oracle datatype; they are more like 'aliases' than different datatypes.
    See the SQL Language doc
    >
    ANSI, DB2, and SQL/DS Datatypes
    SQL statements that create tables and clusters can also use ANSI datatypes and datatypes from the IBM products SQL/DS and DB2. Oracle recognizes the ANSI or IBM datatype name that differs from the Oracle Database datatype name. It converts the datatype to the equivalent Oracle datatype, records the Oracle datatype as the name of the column datatype, and stores the column data in the Oracle datatype based on the conversions shown in the tables that follow.
    INTEGER
    INT
    SMALLINT
    NUMBER(38)
    FLOAT (Note b)
    DOUBLE PRECISION (Note c)
    REAL (Note d)
    FLOAT(126)
    FLOAT(126)
    FLOAT(63)

  • A date column, with timestamp..how to remove timestamp

    Hi,
    I have a table name CATCH, with one of its fieldnamed DATE, using DATE datatype.
    The date format incudes timestamp,can anyone help me how to remove the timestamp part.
    I only want the date part only. I have tried this:
    Update CATCH set DATE=to_char(date,'DD-MON-YYYY');
    but the result of all the date inside the table still having timestamp.
    then i use this:
    Update CATCH set DATE=to_date(date,'DD-MON-YYYY');
    and the result still the same.
    Can anyone advice on this? pls.
    Thanks

    user9353110 wrote:
    Thank you very much..if thats the case, can we remove the timestamp when creating view for this table?no, you can never remove the time component of a DATE.
    If you don't want to show the time for a date (display purposes only!), use TO_CHAR to "transform" the DATE to a string with the appropriate format mask
    SQL> alter session set nls_date_format = 'dd-mm-yyyy hh24:mi'
      2  /
    Session altered.
    SQL> select sysdate
      2    from dual
      3  /
    SYSDATE
    17-03-2010 09:28
    SQL> select to_char (sysdate, 'dd-Mon-yyyy')
      2    from dual
      3  /
    TO_CHAR(SYSDATE,'
    17-Mar-2010
    SQL> select to_char (sysdate, 'yyyy-MON-dd')
      2    from dual
      3  /
    TO_CHAR(SYSDATE,'
    2010-MAR-17
    SQL> NOTE: the last two example are not DATEs! They are STRING

  • Setting date parameters with yesterdays date

    Hi everyone.
    I have a very basic report where I have two date fields as parameters, 'From Date' and 'To Date'.
    I want the From date to default to yesterday, and the To date to default to today.
    I can set todays date simply by adding DEFAULT sy-datum to the parameter.
    But I've been unable to figure out how to set yesterdays date.
    I tried adding some code before the parameters eg:
    lv_yesterday = sy-datum - 1.
    and then add DEFAULT lv_yesterday to the parameter but it doesn't do anything.
    Anybody able to help here? Seems rather trivial but no luck so far!
    Moderator message - You're right, this is a pretty basic question. Please search before asking - post locked
    Edited by: Rob Burbank on Jun 23, 2009 5:21 PM
    Moderator message - OK - I'm going to unlock it long enough so that you can mark David's solution as - solved your problem (I'd use INITIALIZATION rather than LOAD-OF-PROGRAM though
    Edited by: Rob Burbank on Jun 23, 2009 5:23 PM

    Hello Kieran,
    I think you need to calculate the date in the LOAD-OF-PROGRAM event block:
    REPORT z_test.
    DATA: gv_yesterday TYPE d.
    PARAMETERS:
      pa_date TYPE d DEFAULT gv_yesterday.
    LOAD-OF-PROGRAM.
      gv_yesterday = sy-datum - 1.
    Best regards
    David

  • FORMCALC (or JS) Default date today with user override questions

    I have a date field where if null, I want today to be inserted. If the user overrides the today date and saves the form, I want the user entered date to stay.
    What I have in FORMCALC is:
    if ($.isNull)
    then
    $.rawValue = num2date(date(), DateFmt(2))
    endif
    The first part works, it populates with today, and I can overrided the date. When I save and then reopen the form, the date is "0".
    Any ideas here?

    I'm having the same problem as described above but I am using JavaScript to reflect the current date:
    var msNow = (new Date()).getTime();
    var d1 = new Date(msNow);
    this.rawValue = util.printd("mm/dd/yyyy", d1);
    The user can override the current date and save the form, BUT when the form is reopened it will run again and insert the current date over the user entered date.
    (I've tried several variations of "if (this.isNull)" to the above code which results in "01/00/0000" when opening the saved form --so it still doesn't retain the date entered by the user.)
    Does anyone know what code I need to add to to keep the user entered date that was saved with the form? Or if there is a better way to make the date calendar default to today, allow user override and save that user entered date on the form?

  • "System error: Move error" on comparing DATE rows with literal timestamps

    say, I have a table consisting of a DATE and a TIMESTAMP column:
      create table test (
      d date,
      ts timestamp
    now the problem:
    when I try to retrieve values using a statement like this (using MaxDB's SQL Studio or via JDBC):
      select * from test
      where  d >= {ts '2007-06-18 12:19:45'}
    it produces the following error:
      General error;-9111 POS(36) System error: Move error
    So, I am not able to compare DATE columns with timestamp values?
    In contrast, the following combinations all work flawlessly:
      select * from test
      where  d >= {ts '2007-06-18 12:19:45'}
      select * from test
      where ts >= {d '2007-06-18'}
      select * from test
      where  ts >= {ts '2007-06-18 12:19:45'}
    Thus, the opposite direction (comparing a TIMESTAMP column to a literal date value) apparently poses no problem to the MaxDB database engine.
    Unfortunately, I cannot just resort to "truncating" the timestamp values and using the {d ...}-Syntax, because I am using Apache's Torque object-relational mapper which generates the statement like this and feeds the JDBC API with it. Anyway, I deem this a bug in MaxDB, especially with respect to the quite obscure error message.
    I can reproduce this issue on both MaxDB 7.5 and 7.6 server, using client software (SQL Studio), version 7.5 and 7.6 as well.
    Does anybody know this problem?
    TIA,
    Alex

    Hi,
    this is a new bug and we will fix it with one of the next versions of MaxDB.
    You can watch the proceeding in our internal bug tracking system:
    http://www.sapdb.org/webpts?wptsdetail=yes&ErrorType=0&ErrorID=1151609
    Thank you for reporting it.
    Kind regards
    Holger

  • "Source not found" Error creating URL Data control with query parameters

    Hi,
    I have a restful service for which i want to create a URL data control. I am able to create the URL data control successfully when i am not passing any parameters in the Source field. But if i am specifying the parameters in the source field like this Department=##ParamName##, something weird is happening. After giving the param string in the Source field, it asks for default param value to test the url. It tests the url successfully. After that i select XML as the data format in which i am mentioning the xsd like this . "file:///C:/..../something.xsd" . And this is when i am getting the error. "Invalid Connection. The source is not found". I am giving exactly same path for xsd which i gave while creating URL data control without query parameters. Infact i was able to create the URL data control with query parameters successfully till afternoon. after that it started giving me this error all of a sudden. Infact as soon as i was able to create a URL data contol with query parameter successfully, i took a backup of the application before moving further. But even that backup is not working now.
    As far as i understand, i dont think there will be any change in xsd if query params are passed to a web service. Please correct me if i am wrong.
    Just dont know what could be the issue. Please help
    Thanks

    Hi,
    xsd is used for the URL service to know what the returned data structure is so it can create the ADF DC metadata
    Frank

  • Set date Parameters to Default to Current Quarter

    I have 2 date parameters in my report. I would like these parameters to be defaulted to the 1st day of the current quarter and the last day of the current quarter. I need these to be dafaulted because the report is going to be scheduled through BusinessObjects InfoView. I need the flexabilty to allow users to run the report on any date they want, but it needs to default so the scheduling works as expected. Can this be done and if so any assistance would be grateful. Thank you.

    Thomas,
    although you can't set a prompt / parameter to default like this, you can set a record selection to do this...here's how...
    1) in your StartDate and your EndDate parameters set a default value of 1888,08,08
    2) create a new formula called Start with syntax like
    if {?startdate} = date(1888,08,08)
    then
    if month(currentdate) in [1,2,3] then date(year(currentdate),01,01) else
    if month(currentdate) in [4,5,6] then date(year(currentdate),04,01) else
    if month(currentdate) in [7,8,9] then date(year(currentdate),07,01) else
    if month(currentdate) in [10,11,12] then date(year(currentdate),10,01)
    else {?startdate};
    3) create a new formula called End with syntax like
    if {?enddate} = date(1888,08,08)
    then
    if month(currentdate) in [1,2,3] then date(year(currentdate),03,31) else
    if month(currentdate) in [4,5,6] then date(year(currentdate),06,30) else
    if month(currentdate) in [7,8,9] then date(year(currentdate),09,30) else
    if month(currentdate) in [10,11,12] then date(year(currentdate),12,31)
    else {?enddate};
    4) change your record selection formula to something like
    {table.datefield} in {@start} to {@end}
    now if the end user doesn't actually put in custom dates, the record filter will default to the current quarter. if they use custom dates, the those dates will be used.
    of course you will have to edit the above syntax to your parameter names and datefield name. this method will also pass the filter to the database to increase performance.
    cheers,
    jamie

  • Timestamp Parameters With Zero Scale Must Have a Precision of 13, 16, Or 19.

    Hi Madhu  Provide full target table name for target under session properties - mapping - target table- target table name.suppose if schema is abc and table name is dbo.blr then given target table name = abc.dbo.blr It has worked for us and hopeful that it ll work for you too. RegardsNitish

    Hi, I am getting the following error when I try to load data from Oracle to SQL.FnName: Execute -- [Informatica][ODBC SQL Server Wire Protocol driver]Timestamp parameters with zero scale must have a precision of 13, 16, or 19. Parameter number: 4, precision: 999.
    FnName: Execute -- [DataDirect][ODBC lib] Function sequence error . Also i am not having any  field in the source as dataTime data type.Not getting exactly where to look for the issue. Please advise. Thanks & Regards,Madhu

  • How to give specific default date with expression in SSRS

    Hi,
    I have to pass some specific kind of dates in "Default Values" section of parameter.
    1st is whenever SSRS report run for any year in default date I want to pass value 1/1/(Current Year), for this I tried many way like , = "1/1/" + DatePart("Y",Now())  also = "1/1/" + Year(Now()) but it
    is giving me error. When I tried both part individually "1/1/" and  DatePart("Y",Now()) , it is working but when I join them with + sign it is giving me error that "input string is not in correct format"
    2nd I want to set up like when package run in month of April, it takes default date as "(Previous Month, which is May)/1/(current Year)" so if I am running report on 4/5/2013 then it in default date it should take 3/1/2013.
    Please help me with the expression. Thanks in advance. 
    Vicky

    Hi Visakh,
    Thanks again.
    I have one more question, I also have start date and end date. In start date I can put your expression as you gave me as below,
    =DateAdd(DateInterval.Month,DateDiff(DateInterval.Month,CDate("01/01/1900"),Now())-1,CDate("01/01/1900"))
    But can you please help me with End date expression?
    In End date I want to put previous month's last date. For example, if active batch is running package on
    12/16/2013 then for End Date parameter it should value "11/30/2013" 
    For  1/16/2014 then for End Date parameter it should value "12/31/2013" 
    For  3/16/2013 then for End Date parameter it should value "2/28/2013" 
    Thanks for your help in advance.
    Vicky

Maybe you are looking for

  • A few questions from a novice

    Hi all My leopard was an unexpected gift from my parents for my daughter and I, I'm sure you can all imagine how delighted we have been and what an exciting new world that has begun to open up for us. However I have hit a wall a few times over certai

  • How to build a multiselect with (nested) and and or conditions

    Hi, I have to tables: persons and categories. I would like to build functionality to enter values for categories, with a combination of and- and or- conditions (nested) to select persons. Has anyone an example how to do this ? Any reaction will be ap

  • After upgrading itunes to 7.7.1 touch makes  windows restart

    Since ugrading when I plug my ipod touch in it cause windows to restart. My older nano doesn't do this. I am running win xp pro SP2. thaks with any ideas?

  • How to update a Z table by sm31

    hi guys, i need to update some z tables, i know that there is a way in TXN se11 the option utilities, create update.tab, but that ask me for a FM!! do i need to create a fm for each table? is there any standard fm for updating tables? i need to modif

  • Nokia x6

    hi my nokia x6 is due to the bin, but before I do that I would love to save all my contacts and old msgs. Now the big deal is that the unlock switch is broken and right now I cannot even just browse them. After downloading the nokia pc suite I have