Converting a SQL Command Parameter from Date to Char

Hi,
I'm using CR XI version 11.0.0.1282.  I've created a report using a SQL Command and have a parameter defined as Date.  I need to convert this Date parameter to a CHAR and have created my WHERE clause as:
WHERE  "CC_PAYH"."PPOST"= CHAR ('{?From Date}') AND
"CC_PAYH"."PPTYPE"<>13
I get a message saying 2008 is not a valid token which in AS400 means it doesn't like the year.  Go figure. 
I've tried running a similar query in AS400 and I get the desired affect.  I've tried removing the parameter from the Where clause and putting it into the Select like:
CHAR ('{?From Date}') as MyTestDate
just to see the representation I would get and I get the same error. 
The question I have like everyone else is; is this possible with this version of Crystal?  I assume so since the same query will work in the database itself. 
Thanks,
Brian

Hi Brain,
    Can you please try the query similar to the following syntax and verify whether it helps you!
Select * from Orders where ([Order Date]) =
CStr({?Date})
Regards,
Vinay

Similar Messages

  • How to find out the failed sql command and its data from DEFERROR

    Hi,
    has anybody a procedure or some other possibilities to read the content of column USER_DATA of the advanced replication view DEFERROR in order to find out the failed sql command and its column values?
    Thanks in advance.

    Hi Vishwa,
                 The control would be something like this for navigation in Get_p_xxx method u mention as link and u mention a event name which gets triggered on the click of this hyperlink. So your GET_P_XXX method would have the following code:
    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
        WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
          rv_value = 'EXAMPLE'.
    Now you have to create a method as EH_ONEXAMPLE at your IMPL class and within which you would give an outbound plug method. Within the outbound plug the target data would be filled in the collection and window outbound plug would be triggered.
    This is a huge topic and  i have just mentioned you basic things.
    Regards,
    Bharathy.

  • How to pass SQL command parameter using OpenDocument

    Hi !
    I have a dynamic List of values configured in Business View manager, used across multiple reports.
    The data source for this LOV is a SQL Command which accepts a static parameter named stringParam. I need to pass this static parameter in the URL using OpenDocument command. How can I do this?
    I tried
    http://bobjdev/businessobjects/enterprise115/InfoView/scripts/opendocument.aspx?spath=[ReportFolder]&sDocName=WebReport.rpt&stype=rpt&lsSstringParam=ABC
    but it still prompts me to select the parameter. I need to avoid this prompt.
    Any help, please.

    Hi,
    I would recommend to take a look at the documentation in order to identify the correct syntax for your URL
    [http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf]
    Regards,
    Shweta

  • Cannot change SQL command text in Data Flow Task

    I have an SSIS package that extracts data from Teradata into a SQL Server DB.
    I'm using SQL Server 2008 R2 EE x64, and Visual Studio 2008 PE (BIDS) supplied with it, accessing Teradata v13.
    In the Integration Services project, I have a Data Flow Task, it has an ADO .net source which has Data access mode set to “SQL Command”.
    This worked for a while when I initially entered a SQL statement to select data.
    But, when I change the existing SQL Command text and save the package, the changes are lost.
    It keeps going back to the original SQL Statement.
    It is currently “select col1, col2, … col10 from view1”.
    When I change it to anything else, like “select col5 from view1”, and save, and then double click the ADO NET source again, I find that the SQL command text is still the old one. It goes back to the previous statement.
    I’ve tried other statements like “exec macro” for Teradata, etc. but the same thing keeps happening - changes are not saved.
    Does anyone have any ideas on this, or have you seen this before?

    This is odd, but seems to be a component metadata corruption; so why don't you:
    delete the teradata connector and source component, then re add them back, see if it now accepts the new SQL statement, if this does not work
    abandon this package and create a new one replicating the functionality incorporating the new SQL.
    In case #1 and 2 both fail post here any errors observed and find out whether you are missing any updates to either Teradata provider or SQL Server
    Arthur My Blog

  • SQL Command to display date in between

    Hello Friends
    Is there any open sql command which will display sum(qty) between dates  in one command , I know it is there like decode etc but cannot remember.
    Eg
    select sum(fkimg,010107 , 310107) from table into
    wa   where plant = xxxxxx
    regards
    Piroz

    Hi
    Yes I know doing by giving date range you can do it but if i need between this date to date
    select * from s903
    into wa where
    fkdat between 010107 and 310107
    how can i put the condition to display month wise individually
    into jan,feb,mar,apr accordingly when the date range is selected it must go into each column separately
    Is there any clue to start please, I am really stuck and it is very urgent
    regards
    Piroz

  • Sql command Help from prompt

    How to invoke the online sql command syntax help from the
    sql prompt
    Regards
    RA

    I think you have posted to the wrong forum
    Business Intelligence Beans Product Management Team
    Oracle Corporation

  • Using stored parameter from data control class with stacked bar-graph

    Hi folks,
    I'm relatively new to ADF & EJB so I want to apologise in advance if this question seems rudimentary to many of you.
    Edit:  I should have mentioned that I'm using JDeveloper 11.1.1.5
    I'm having a hard time determining how to retrieve the value from a variable to be assigned to a property of the bar graph I'm trying to display on my JSF page.
    I have tried to briefly summarise the logic below for reference.
    I have a data control class (ActivityChart) that includes a method "getActivityDetail" returns a List of custom Objects (ActivityDTO) that are the underlying data for my bar graph.
    public class ActivityChart {
        private Double axisScale;
        public ActivityChart() {
            super();
            axisScale = 0.0;
        public List<ActivityDTO> getActivityDetail(List<String> businessUnits) {
            List<ActivityDTO> returnNewList = new ArrayList<ActivityDTO>();
            List<TransactionDTO> dataList = new ArrayList<TransactionDTO>();
            TransactionSessionBean transBean = lookupTransactionSessionBean();
            if (businessUnits != null && !businessUnits.isEmpty()){
                dataList = transBean.getActivityData(SystemUtil.getCurrentUser(), businessUnits);           
                returnNewList = processTransactions(dataList);
                axisScale = calcAxisScale(returnNewList);
            return returnNewList;
    ...The TransactionDTO object is basically a mirror of the entity object to store the fields from the queried db transactions.
    The ActivityDTO object contains a String value (x-axis label) and 3 Double values for the values required for the bar graph.
    What I'm trying to do is dynamically set the scale for the 2 y-axes (I'm using a dual-axis stacked bar graph) because the auto calculated values are not aligned.
    Right now I've got the two relevant elements of the bar graph hard-coded with a specific axis value:
    <dvt:y1Axis axisMaxAutoScaled="false" axisMaxValue="100.0"/>
    <dvt:y2Axis axisMaxAutoScaled="false" axisMaxValue="100.0"/>.
    The value I want to use for the Y-axis is calculated and stored in the "axisScale" variable in the above class.
    Really at a loss of how to move forward from here.
    Would very much appreciate any guidance/direction offered.
    Thanks,
    Karim
    Edited by: 973742 on Nov 28, 2012 8:12 AM

    Looks like I may have found the answer!
    I had to set up the variable in the bindings for the page and then reference the variable from the binding and add the property inputValue.
    ie. value="#{bindings.axisScale.inputValue}"

  • SQL Command to select MAX(date) & Max(time)

    My am having a really hard time getting a sql command to return data with the max(date) & max(time) combination. I think I need a sub query but can not figure it out. I have looked all over the internet but still don't understand it. Below is my command which returns the max date & max time but they are not from the same row of data. Please help.
    SELECT  "labor"."order-no", "labor"."oper-no", MAX("labor"."end-date") AS myDate, Max("labor"."end-time") AS myTime
    FROM   "E940LIVE"."PUB"."tm-log" "labor"
    WHERE  "labor"."order-no"='73153-bc' AND "labor"."company"='01'
    GROUP BY  "labor"."order-no", "labor"."oper-no"

    Progress does not support the DATEADD function. Waht if I forget the number is time and look at it just as a number. Here is my data and what I have tried (again I don't understand the multiple select concept yet).
    Data
    oper-no   end-date    end-time
      20      2/2/2010     41,975
      30      2/3/2010     45,906
      30      2/16/2010    32,941
      40      2/4/2010     46,099
      40      2/4/2010     50,227
      40      2/4/2010     59,466
      40      2/4/2010     62,024
      40      2/16/2010    43,838
      60      2/17/2010    32,679
      90      2/25/2010    35,270
    SQL Command
    SELECT a."oper-no", a."end-time", a."end-date"
    FROM   "E940LIVE"."PUB"."tm-log" a, (SELECT "end-time", max("end-date") AS max_date FROM "E940LIVE"."PUB"."tm-log" WHERE  "order-no"='73153-bc' AND "company"='01' GROUP BY "end-date", "end-time") b
    WHERE  a."end-time" = b."end-time" AND a."end-date" = b.max_date AND a."order-no"='73153-bc' AND a."company"='01'
    Result
    oper-no   end-date     end-time
      20      2/2/2010      41,975
      30      2/3/2010      45,906
      40      2/4/2010      50,227
      40      2/4/2010      46,099
      40      2/4/2010      59,466
      40      2/4/2010      62,024
      30      2/16/2010     32,941
      40      2/16/2010     43,838
      60      2/17/2010     32,679
      90      2/25/2010     35,270
    Desired Result
    oper-no   end-date    end-time
      20      2/2/2010     41,975
      30      2/16/2010    32,941
      40      2/16/2010    43,838
      60      2/17/2010    32,679
      90      2/25/2010    35,270
    Thanks for any and all help!
    Wayne

  • Defining SQL Command

    I am trying to learn more about the Defining SQL Command in the Database Expert.
    I understand from what I've read that it can be used to create a virtual table that can provide access to a smaller number of fields and records than the entire database, so that accessing the data is quicker.  Also, if you need this data structure across reports, you can save the command to the Repository.
    I understand that such a virtual table would be helpful with a large database having a lot of fields.  It would reduce the number of fields in Field Explorer, which would make designing a report easier. 
    I don't understand why it would be necessary to parcel out certain records, though.  Doesn't the Record Selection Formula do the same thing -- it only pulls into the report those records that are needed?  If someone could explain this further, I'd appreciate it.
    Are there other benefits (or disadvantages) of the SQL Command functionality that I'm missing?
    If there are any readings out there that discuss the SQL Command in Crystal, I'd appreciate the reference.
    Thanks.
    Gary

    When designing a Crystal Report using the tables directly, and there is a Record Selection formula, Crystal can (sometimes) push the record selection to the database.  When the report is based on an SQL Command, Crystal can't to that (I don't think).
    By adding record selection to the SQL Command, the number of records fed back to Crystal will be reduced to only those necessary, whereas if you put the selection in the Record Selection formula all of the data will be fed to Crystal, which will then have to sift through it all to select the records to report.  On huge files, that can really hurt performance.
    Another huge benefit of using the SQL Command is with data aggregation.  If you are writing a summary report and let the database do the summing, it will return far fewer records to Crystal (can be many orders of magnitude depending on the data and aggregation level) and Crystal won't have to do the aggregation.
    Table joins are also almost always quicker in a database than what Crystal can do (depending on database design).
    IMHO, I would base (virtually) all of my reports on an SQL command that does all of the data manipulation required by the report, returning only the data required for Crystal to format and display.  (I know there are arguments not to do this - some with great merit - but generally speaking I believe this to be the best performance-wise.)  After all, that's what databases are built to do!
    HTH,
    Carl

  • Validation Error - An error occured executing the provided SQL Command

    Hi All,
    I am new to using SQL Server in general (2008 R2) and am trying to change the source location for multiple packages in order to obtain our data from a more reliable environment.
    I have created a copy of the target database where the data will be loaded, amended the source and target connection managers and ran through the packages to ensure they work, which many do.
    We are changing the source from a local server to a cloud based server and when running a package that literally truncates target table, selects * from source, and inserts data to target I get a validation error "An error occurred executing the provided
    SQL Command "Select *...." The connection has been disabled" and "component ADO NET Source failed validation and returned validation status "VS_ISBROKEN"".
    The table structure from the 2 sources is the same and I have even recreated the data flow tasks to ensure the metadata has updated. When selecting 100 rows or even 5,000,000 rows from source the package runs fine but will fail as above
    when selecting &* (around 9.5 million rows).
    I'm not sure if this is due to the new data source being web based or if it could be some erroneous data in the table that isn't being selected when limiting to 5 milling rows etc.
    I have spend hours trying to figure out what the issue could be (doesn't help being new to SQL Server) so any guidance would be hugely appreciated!!!
    Thanks,
    Louis.

    Hi All,
    Unfortunately I don't believe any of the above are the issues.
    Our current working project/packages run via an SQL agent job daily. To test and ensure the package in question ran outside of the agent WITHOUT changing the ADO NET Source I exported the package (that runs daily) and ran it locally,
    to which it failed.
    I then edited the select statement from 'select * from [table]' to 'select top(100) from [table] to which it ran without error.
    So in summary:
    Package will run fine if run as part of the agent job (with multiple other packages)
    Package will not run from File System when selecting * from the source table
    Package will run from File System when selecting limited rows
    Could this be something to do with permissions? The errors I get are:
    An error occurred executing the provided SQL command: "select * from [table]". The connection has been disabled.
    "component" ADO NET Source"(396") failed validation and returned validation status "VS_ISBROKEN".
    Thanks,
    Louis.

  • Possible bug in SQL Commands – object required

    Hello,
    I tried to run the following in the SQL Commands:
    select * from emp
    where empno = (select MIN(empno)
                 from emp
                 where empno > :ITEM)If memory serve, it was suppose to open a pop up window, and allow me to enter a value for the bind variable. What I'm getting is a run time error about object required. Am I missing something?
    Thanks,
    Arie.

    Hi Dimitri,
    Yes, you are correct. It's strange though, because I don't remember such a behavior in the past, and also with this current browser configuration, I don't seems to have any problems with date pickers or help windows. I should probably look into it a bit deeper.
    Thanks,
    Arie.

  • NLS_LENGTH_SEMENTICS from BYTE TO CHAR

    Hi,
    For supporting multibyte character, we need to change NLS_LENGTH_SEMENTICS parameter from BYTE to CHAR. But this parameter setting will effect for new database tables created thereafter. To change the storage characteristics for existing database tables we explicitly executed Alter statements for database tables for columns having datatype as “Varchar2” and “Char”.
    Problem:
    ======
    Since the number of database tables in PRODUCTION are very high and contains approx. 600 million of records spread over 400 database tables, we are not in a position to afford the time which will be spent in altering these database tables in PRODUCTION.
    We ran the test by alter script in System Test environment and alteration of database tables covering 150 tables and 200 million of records was carried out in almost 16-20 hrs.
    APPROACHES WE HAVE IN MIND
    ==========================
    1. Alter all the table columns (We tried the same and taking too much time)
    2. Export /Import with NLS_LENGTH_SEMENTICS set as CHAR(We discuss with our DBA about this approach and found that it will also take too much time and there is RISK of data inconsistency)
    3. Drop the index of the table, run alter script for changing storage type BYTE to CHAR , and rebuild the index (this is also taking too much time).
    All above approaches are very costly in terms of time, that we cannot afford.
    If any one having better solution then please suggest.
    thanks in advance
    Syed

    Hi
    We are also facing a similar problem
    We ran alter table scripts and now compiling the objects
    and that is taking lot of time.
    we have around 4000 invalids that by parallel recomp came down to 2000 but still these 2000 which are mostly packages .. are giving a hard time.
    if anyone has faced/found a similar issue/solution pls post. or maildirectly to me.
    Sunil Choudhary

  • Converting Crystal Date Group to SQL Command

    When selecting the option to group on the server, I found that there are requirements in addition to selecting the option.
    I have a date grouping in Crystal like the following:
    dateadd("d", - weekday({table.date}, crMonday)+1,{table.date})
    Can this be converted to a SQL command?

    Hi Mark,
    Jyothi had given  an excellent query for you,  Congrats Jyothy!!
    But she didnt mantioned 'From clouse' on that.
    Let me correct that query with an example,
    My TableName: Invoice
    Primary Key: InvoicePID
    Date field:InvoiceDate
    Here the query will be
    select InvoicePID,  Dateadd(d,-(CASE  WHEN DATEName(dw,Invoice.InvoiceDate ) = 'Monday' THEN 1
                            WHEN DATEName(dw,Invoice.InvoiceDate ) = 'Tuesday' THEN 2     
                             WHEN DATEName(dw,Invoice.InvoiceDate ) = 'Wednesday' THEN 3
                             WHEN DATEName(dw,Invoice.InvoiceDate ) = 'Thursday' THEN 4
                             WHEN DATEName(dw,Invoice.InvoiceDate ) = 'Friday' THEN 5
                             WHEN DATEName(dw,Invoice.InvoiceDate ) = 'Saturday' THEN 6
                             WHEN DATEName(dw,Invoice.InvoiceDate ) = 'Sunday' THEN 7
    END
    )+1 ,Invoice.InvoiceDate)
    from Invoice
    You can change the tablename and field with respect to your DB.
    regards,
    Salah.

  • Read from sql task and send to data flow task - [OLE DB Source [1]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.

    I have created a execut sql task -
    In that, i have a created a 'empidvar' variable of string type and put sqlstatement = 'select distinct empid from emp'
    Resultset=resultname=0 and variablename=empidvar
    I have added data flow task of ole db type and I put this sql statement under sql command - exec emp_sp @empidvar=?
    I am getting an error.
    [OLE DB Source [1]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.
    [SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute phase and returned error code 0xC02092B4.

    shouldnt setting be Result
    Set=Full Resultset as your query returns a resultset? also i think variable to be mapped should be of object type.
    Then for data flow task also you need to put it inside a ForEachLoop based on ADO.NET recordset and map your earlier variable inside it so as to iterate for every value the sql task returns.
    Also if using SP in oledb source make sure you read this
    http://consultingblogs.emc.com/jamiethomson/archive/2006/12/20/SSIS_3A00_-Using-stored-procedures-inside-an-OLE-DB-Source-component.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Passing Parameter from Main report to SQL command-based subreport

    I am trying to cut down the run time of my reports and have recently figured out how to write SQL commands to limit the data by filtering prior to being pulled into the reports.  However, many of my reports rely on multiple sub reports, which can cause a dramatic 'drag' on the report.
    I am trying to filter the SQL command used in my sub report by passing the group parameter, which is selected by the user in the main report, to the sub report's SQL command.  Without this parameter, the sub report has to sort through a lot more data than it would with this parameter, making the run time extremely slow.
    Any suggestions on how I can accomplish this?
    Thanks for any help you can provide,
    Marlene Allen
    Crystal Reports Developer
    Crystal Reports Professional;
    Product Type: Full;
    Product Version 11.5

    Hi Marlene,
    I don't believe you can pass a CR parameter to a Command object.
    I suggest replacing all of the Command Objects with a Stored Procedure so all of the data filtering is done server side. DB servers are much more proficient at collecting the data and filtering than CR will ever be. It will also allow you to replace subreports to also speed up your report processing. All depends on your layout of course but something to look at.
    Thank you
    Don

Maybe you are looking for

  • How to put adsense in iphone app?

    hi Please tell me about How to put adsense in iphone application please send me sample code

  • Start Screen Layout not applying to every user

    Ok, i'm stuck.  I have a 2012r2  DC with a 2012r2 terminal server.  I exported the xml file to be the start screen layout and have it applied to a specific user OU with my two users in it.  One gets the layout the other does not (metro layout btw)  S

  • C Project Accounting integration

    Hi all, Pls help me come out of this accounitng integration problem in cprojects. The object type 0FIN_INT_ERP_PS  is not appearing in Define Object types Node. Instead I have one object type as 0FIN_INT_PROJ , but his is not helping. and also this i

  • Conflict between MAIL and AOL - cannot send! same port?

    I just spent an hour on the phone with a very nice Apple tech and it turns out that the reason I cannot send mail (I can, intermittently) on my Mac mail application is that it conflicts (he believes) with aol, i.e. perhaps they are sharing the same p

  • Inaccessible_Boot_Device error message in W2K.

    Hi, I just bought a Maxtor 200 Gig Ultra ATA hard drive. I moved my partitions over on it and Windows 2000 refuses to load or even do a new install on this hard drive. It says the partition in "damaged". (Of course, it's not.) I've never run into thi