Query expression help

Hello -
I am very new to query in PeopleSoft. I need to calculate the amount of days that a position in HCM has been in a 'frozen' status.
I know that I need to subtract the STATUS_DT from the current date (date that the query is run) and then show the results as a number in its own column, but I cannot get my expression to work. Is anyone familiar with this?
Thank you in advance!

This is the error I get:
SQL error occurred. Please consult your system log for details.
Error in running query because of SQL Error, Code=8601, Message=[Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor. [Microsoft][SQL Native Client][SQL Server]'TO_DATE' is not a recognized built-in function name. [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near the keyword 'AND' (50,380)
When I create the expression, I can do the following:
Select Expression Type (Char, Num, Date, etc). I am choosing Number.
Select the Length fo the characters. I am putting 4 as the length.
Enter in Expression Text. I am entering your text into this field and replacing STATUS_DT with E.STATUS_DT.
Like I said. i am new at this, so might need a more basic explanation.

Similar Messages

  • Missing operator in query expression (Help)

    Hi I'm trying to implement "OR" into my SQL statement and I think I'm doing something wrong.. Could someone take a quick look at my query and tell me where I'm missing this operator.
    int insert=stmt.executeUpdate("INSERT INTO tblTest(EnglishName, FileName, RlsID, InitRlsInd, DirID, ObsoleteRlsInd) VALUES
    ("+"\'"+jTextFieldName.getText()+"\'"+","+
    "\'"+jTextFieldFileName.getText()+"\'"+","+
    "\'"+getComboID(jComboBoxRelease)+"\'"+","+
    "\'"+getRadioID(jRadioButtonInitRlsY)+"\'"+","+"OR"+getRadioID (jRadioButtonInitRlsN)+"\'"+","+
    "\'"+getComboID(jComboBoxDirectory)+"\'"+","+
    "\'"+getRadioID(jRadioButtonObsoRlsY)+"\'"+","+"OR"+getRadioID(jRadioButtonObsoRlsN)+"\'"+ ")");
    Thanks in advance.

    cotton if your still out there..
    String sql = "INSERT INTO tblTest("
    + "EnglishName,"
    + "FileName,"
    + "RlsID,"
    + "InitRlsInd,"
    + "DirID,"
    + "ObsoleteRlsInd,"
    + "VALUES(?,?,?,?,?,?)";
    PreparedStatement pstmt = dB.prepareStatement(sql);
    Now if I use pstmt and continue my INSERT I am not able to implement the values the users will put into the text and combo boxes..
    I tried this for the textbox, but it doesn't work... pstmt.setString(jTextFieldName.getText()); I know this is obviously wrong, but I'm unfirmilar with prepared statments and I looked at the Java Docs and they don't show a specific example for what I want to do.. Atleast what I found doesnt. Could you show me a quick example??
    Thanks,

  • Missing operator in query expression

    Greetings,
    I'm attempting to access a MS Acess database, but getting the following error.
    Syntax error (missing operator) in query expression 'Org Name'.
    The error occurs between the following two lines.
    String SQL = "SELECT Org Name FROM OrganizationTable";
    ResultSet resultset = statement.executeQuery(SQL);Where Org Name is the data set I'm trying to access and OrganizationTable is the database table.
    Any help would be appreciated.

    What is happening is that the interpreter is seeing
    "Org Name" as two different columns and/or values and
    is expecting an operator. Somehow you need to
    indicate that it should be interpreted as a single
    column.
    Try one of these (I'm not sure if one will work since
    I don't work with access much, but I'm guessing that
    it would work similar to other dbs I've used):
    String SQL = "SELECT [Org Name] FROM
    OrganizationTable";
    or
    String SQL = "SELECT 'Org Name' FROM
    OrganizationTable";
    Thanks boss,
    I started to get it figured as I was able to open a result set that didn't have any whitespace in the name in the same table.
    FYI, [Org Name], did the trick. Single quotes do not work.
    Thanks again :)

  • Named Query Expression in Toplink workbench

    Hi! All,
    I have a problem which I am not sure how to solve and would appreciate any help on this.
    I have Tables
    Company, Employee, EmployeeTaxType , TaxTypeVal
    Each is mapped to a java class with the same name
    I would like to find all Employee Objects for a company where (taxTypeVal.year=2005 and taxType.quarter=2)
    I cant seem to be able to build a Named Query expression which would produce the same result.
    It always returns All employees who belong to a company and have liabilities in either year =2005 OR quarter=2
    The expression that I wrote was
    AND
    1.companyBO.companyID EQUAL COMPANY_ID
    2.AND
    2.1.employeeTaxTypeBOs.taxTypeValBOs.quarter EQUAL QUARTER
    2.2.employeeTaxTypeBOs.taxTypeValBOs.year EQUAL YEAR

    Please post the SQL that is generated from TopLink, and the xml where you define the NamedQuery. What version of the MappingWorkbench and TopLink runtime are you using?
    Deepak

  • Malformed GUID. in query expression

    Hello I have a script that was developed a long time ago. I
    wish to use it now, However i'm receiving the following errors. Is
    this because it was developed with an older version of CF? Can
    anyone spot out what I can change to make this work. Im running
    CFmx7. Any help is much appreciated.
    Thanks,
    Brian
    Error Executing Database Query.
    Malformed GUID. in query expression 'EVENT.Inactive = 0 AND
    EventPrivate = 0 AND Event.TaskID = 0 and { fn MONTH(EventDate)} =
    { fn MONTH( #2007-11-29 10:38:13# )} AND { fn YEAR(EventDate)} = {
    fn YEAR( #2007-11-29 10:38:13# )}'.
    <CFQUERY NAME="GetEvents"
    DATASOURCE="#application.datasource#">
    SELECT
    EventCategory.EventCategory,EventPrivate,EVENT.EventCatID,EventDate,EventDateEnd,EventNoT ime,EventDescr,EventID,EventName,EventDate
    FROM EVENT left join EventCategory on EVENT.EventCatID =
    EventCategory.EventCatID
    WHERE EVENT.Inactive = 0 AND EventPrivate = 0 AND
    <cfif session.userid is "">
    Event.TaskID = 0 and
    <cfelse>
    <cfif #session.userTasks# neq 0> (Event.TaskID IN
    (#session.userTasks#) or (Event.TaskID = 0 )) and </cfif>
    <cfif #session.SrchTaskid# neq 0> Event.TaskID =
    #session.SrchTaskid# and </cfif>
    </cfif>
    {fn MONTH(EventDate)}={fn MONTH(#ThisDate#)} AND
    {fn YEAR(EventDate)}={fn YEAR(#ThisDate#)}
    <cfif CatIDs neq 0>
    AND EVENT.EventCatID in (#PreserveSingleQuotes(CatIDs)#)
    </cfif>
    </CFQUERY>

    You might be missing an AND keyword with all that if/else
    logic in your your sql
    I'm assuming that this:
    {fn YEAR(EventDate)}={fn YEAR(#ThisDate#)}
    is the way you call functions when using something other than
    cold fusion. Try changing it to
    YEAR(EventDate) = YEAR(#ThisDate#)

  • How to improve the performance of the attached query, Please help

    Hi,
    How to improve performance of the below query, Please help. also attached explain plan -
    SELECT Camp.Id,
    rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount,
    (SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
    rCam.AccountKey as AccountKey
    FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
    WHERE Camp.AccountKey = rCam.AccountKey
    AND Camp.AvCampaignKey = rCam.AvCampaignKey
    AND Camp.AccountKey = CamBilling.AccountKey
    AND Camp.CampaignKey = CamBilling.CampaignKey
    AND rCam.AccountKey = xSite.AccountKey
    AND rCam.AvSiteKey = xSite.AvSiteKey
    AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
    to_date('01-01-2011', 'DD-MM-YYYY')
    GROUP By rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount
    Explain Plan :-
    Description                    Object_owner          Object_name     Cost     Cardinality     Bytes     
    SELECT STATEMENT, GOAL = ALL_ROWS                              14     1     13
    SORT AGGREGATE                                                  1     13
    VIEW                         GEMINI_REPORTING               14     1     13
    HASH GROUP BY                                        14     1     103
    NESTED LOOPS                                        13     1     103
    HASH JOIN                                             12     1     85
    TABLE ACCESS BY INDEX ROWID     GEMINI_REPORTING     RCAMSIT          2     4     100
    NESTED LOOPS                                        9     5     325
    HASH JOIN                                        7     1     40
    SORT UNIQUE                                        2     1     18
    TABLE ACCESS BY INDEX ROWID     GEMINI_PRIMARY          SITE          2     1     18
    INDEX RANGE SCAN          GEMINI_PRIMARY          SITE_I0          1     1     
    TABLE ACCESS FULL          GEMINI_PRIMARY          SITE          3     27     594
    INDEX RANGE SCAN          GEMINI_REPORTING     RCAMSIT_I     1     1     5     
    TABLE ACCESS FULL     GEMINI_PRIMARY     CAMPAIGN                    3     127     2540
    TABLE ACCESS BY INDEX ROWID     GEMINI_PRIMARY          CAMBILLING     1     1     18
    INDEX UNIQUE SCAN     GEMINI_PRIMARY     CAMBILLING_U1                    0     1

    Hello,
    This has really nothing to do with the Oracle Forms product.
    Please, send the SQL or/and PL/SQL questions in the corresponding forums.
    Francois

  • Syntax error (missing operator) in query expression works in sql

    Hi guys,
    I am having a problem with this query in Access 2007, it runs
    fine in MSSQL.
    I get this error when I run it.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in query expression
    'tbl_skuoption_rel.optn_rel_Option_ID = tbl_skuoptions.option_ID
    INNER JOIN tbl_skus ON tbl_skuoption_rel.optn_rel_SKU_ID =
    tbl_skus.SKU_ID INNER JOIN tbl_products AS p ON
    tbl_skus.SKU_ProductID = p.product_ID'.

    Access may require parenthesis ( ) around the JOINs when
    joining more than two tables

  • Syntax error in query expression

    I am receiving the following error message:
    Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in query expression 'customerid_cus='.
    for the following code:
    If IsEmpty(Request.Form("company_cus")) Then
    rs_company.Source = "SELECT customerid_cus, company_cus FROM
    customers_cus WHERE customerid_cus= "&
    Request.QueryString("customerid") &" "
    Else
    rs_company.Source = "SELECT customerid_cus, company_cus FROM
    customers_cus WHERE company_cus = '"&
    Request.Form("company_cus") &"' "
    End If
    What could the problem be?

    Are you sure that you are passing the querystring customerid
    when the form
    company_cus is empty.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "aonefun" <[email protected]> wrote in
    message
    news:epmf3n$f3u$[email protected]..
    >I am receiving the following error message:
    >
    > Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator)
    > in
    > query expression 'customerid_cus='.
    >
    > for the following code:
    >
    > If IsEmpty(Request.Form("company_cus")) Then
    >
    > rs_company.Source = "SELECT customerid_cus, company_cus
    FROM
    > customers_cus
    > WHERE customerid_cus= "&
    Request.QueryString("customerid") &" "
    >
    > Else
    >
    > rs_company.Source = "SELECT customerid_cus, company_cus
    FROM
    > customers_cus
    > WHERE company_cus = '"& Request.Form("company_cus")
    >
    > End If
    >
    > What could the problem be?
    >

  • Syntax error (missing operator) in query expression

    Hi all
    I am creating a couple of pages where a dynamic list is created from an access database and then products from that list are displayed, the user then has the option of clicking more details, this then should pass the KITID over to the details page, However when i click on the details page i get the following error
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'KitID = Kit 01'.
    /classicclocks/Kieninger_gallery.asp, line 21
    Here is the code from the page i am building, can anybody see anything obvious here
    strKitID = Request.QueryString("KitID")
    ' If KitID does not exist then redirect to Gallery page
    If strKitID = False Then
      Response.Redirect("kit_gallerytest.asp")
    End If
    ' SQL Query for specific KitID details only
    Dim objRS
    Set objRS = Server.CreateObject ("ADODB.Recordset")
    ' Open new objRS
      strSQL = "SELECT KitID,ImgKitCatalogue,KitDescriptionShort FROM tblMovements WHERE KitID = " & strKitID & " ORDER BY KitID"
      objRS.Open strSQL, MM_dbConn_STRING,,,adCmdTable
      ' Get all rows from table and asign values to array for use in form
      Do While Not(objRS.EOF)
      Images = True
      fsImagesArray = objRS.GetRows()
        Const arrKitID = 0
        Const arrImgKitCatalogue = 1
        Const arrKitDescriptionShort = 2
      Loop
    ' Close objConn and objRS
    objRS.Close
    strSQL = "SELECT * From tblMovements WHERE KitID = " & strKitID
    objRS.Open strSQL, MM_dbConn_STRING
    thanks
    John

    String values in a SQL where clause must be wrapped in quotes. Try this:
    strSQL = "SELECT KitID,ImgKitCatalogue,KitDescriptionShort FROM tblMovements WHERE KitID = '" & strKitID & "' ORDER BY KitID"

  • Will an Airport Express help with the signal I am not receiving on my Smart TV?

    Will the Express help with internet issue's I have with my new Smart TV?

    If you already have another Apple AirPort router that is providing your wireless signal, then a new AirPort Express could extend that wireless signal to provide a stronger wireless signal to the TV....assuming that the TV connects using wireless.
    Is this what you are asking?
    Or, would the Express provide other services to "help"?

  • PeopleCode :: Query API :: Query Expression collection problems

    Hi all,
    I'm trying to use the Query API in PeopleCode to tack on an expression to the end of an existing query. Thus far I have been successful doing just a QueryField without any problems. Here is some example code of what I have done with the Query Expression collection and where I am stuck:
    &Criteria = &MainQrySel.AddCriteria("criteria1");
    &Criteria.Logical = %Query_CombAnd;
    &Criteria.Expr1Type = %Query_Expression;
    &crit = &Criteria.AddExpr1Expression();
    &Criteria.Expr1Expression = &crit;
    &crit.Text = -some expression-;
    &Criteria.Operator = %Query_CondEqual;
    &Criteria.Expr2Type = %Query_ExprConstant;
    &crit = &Criteria.AddExpr2Expression();
    &Criteria.Expr2Expression1 = &crit;
    &crit.Text = -some criteria-;
    So what's happening is that the left hand part of the expression is added to the entire statement along with the operator (the equals sign). The odd part is that the right hand part of the expression is not (basically the -some criteria- part).
    If anyone has any ideas on how to solve this mystery, please let me know...I'm rather confuzzled!
    Thanks in advance!

    Well, I finally discovered he solution on my own, by reverse-engineering Oracle's own search.jsp (which does not use Oracle's custom tag library, btw) (probably because same doesn't really work, or at least it doesn't what's in the documentation doesn't work) (which isn't surprising).
    You have to do the "From" part of the query as an "attribute filter".
    oracle.ultrasearch.query.Query searchQuery=
    new oracle.ultrasearch.query.Contains(searchString, metadata);
    oracle.ultrasearch.query.Query attrQuery=
    new oracle.ultrasearch.query.From(metadata.getGroup(groupToSearch));
    oracle.ultrasearch.query.Request searchRequest=new oracle.ultrasearch.query.Request();
    searchRequest.setQuery(searchQuery);
    searchRequest.setFilter (attrQuery);
    Maybe that will do somebody some good somewhere...
    Troy

  • He query expression 'new f__AnonymousType1 is not supported.

    he query expression 'new <>f__AnonymousType1`1(PercentComplete = s.PercentComplete)' is not supported.
    error message in project server 2013 using object model.
    vijay

    he query expression 'new <>f__AnonymousType1`1(PercentComplete = s.PercentComplete)' is not supported.
    error message in project server 2013 using object model.
    vijay

  • Cluster bar chart- sql query please help-

    Hi,
    I am trying to create cluster bar chart and am stumped with this sql query.Any help is appreciated.
    Here is my table
    city     region      issue     value
    c1     north     i1     y
    c1     north     i2     y
    c2     north     i1     n
    c2     north     i2     y
    c3     south     i1     y
    c3     south     i2     n
    c4     east     i1     n
    c4     east     i2     n
    The bar chart will have 3 series, north south and east.
    And labels will be i1 and i2. value will be number of times this issue was encountered(y) in this region.
    How can I get something like this from the above table-
    region     issue     count(yes)
    north     i1     1
    north     i2     2
    south     i1     1
    south     i2     0
    east     i1     0
    east     i2     0
    thanks

    WITH table1 AS
    (SELECT 1435177 qte_id, 2 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 5 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 7 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 8 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 12 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 14 seq_no
    FROM dual
    table2 AS
    SELECT 1435177 qte_id, 1 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 2 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 3 seq_no, 0 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 4 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 5 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 7 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 8 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 11 seq_no, 59300 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 12 seq_no, 59300 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 14 seq_no, 59300 cmmt_curr_amt
    FROM dual
    SELECT qte_id, t2_seq_no, cmmt_curr_amt - cmmt_curr_lag diff
    FROM
    (SELECT t2.qte_id, t2.seq_no t2_seq_no, t1.seq_no t1_seq_no, cmmt_curr_amt, LAG(cmmt_curr_amt,1,0) OVER (PARTITION BY t2.qte_id ORDER BY t2.seq_no) cmmt_curr_lag
    FROM table1 t1, table2 t2
    WHERE t2.qte_id = t1.qte_id (+)
    AND t2.seq_no = t1.seq_no(+)
    ORDER BY 1,2
    WHERE t1_seq_no IS NOT NULL
    ORDER BY 1,2
    QTE_ID T2_SEQ_NO DIFF
    1435177 2 0
    1435177 5 0
    1435177 7 0
    1435177 8 0
    1435177 12 0
    1435177 14 0

  • Expression too complex in query expression

    Page code creates a string of all ManufacturerPartNumbers
    that share a common ProductFamilyID based on a
    ManufacturerPartNumber form selection. This string is then included
    in the recordset query.
    The following error message only occurs when the
    ManufacturerPartNumber string has numerous listings. When the
    string contains only 3 listings of ManufacturerPartNumbers, this
    error message does not appear.
    [Microsoft][ODBC Microsoft Access Driver] Expression too
    complex in query expression 'LATITUDE &amp;lt;=
    40.8210861895984 AND latitude &amp;gt;= 40.3865898104016 AND
    longitude &amp;gt;= -74.2737786508004 AND longitude
    &amp;lt;= -73.7014913491996 AND
    (((((((((((((((((((((((((((((ManufacturerPartNumber = '3408H')) OR
    ((ManufacturerPartNumber = '4608H'))) OR ((Manufacture'.
    /customer_locator/testprocessform2.asp, line 233
    Is there a size limit to a recordset query that is causing
    this error or is there a possible syntax issue with my query
    code?

    That doesn't sound like an error that would normally occur on a lot of pages... Do you have AdBlock (Plus), or any Greasemonkey userscripts, or any similar add-ons that customize sites? I wonder whether one of those might have some faulty logic.

  • My ipad 2 and ipod touch keeps on dropping wifi connection,  would getting an apple router or maybe airport express help?

    ipad 2 and ipod touch  keeps on dropping wifi, would upgrading to an apple router/airport express help?  all my other pc's work well with my current network.

    Have you checked for a firmware update for your current router?
    What make, model, version router do you have?

Maybe you are looking for

  • Installation RDBMS Oracle11g Express Edition fails on Windows 7 64bits.

    Hi, I want to install an Oracle11g Express Edition on a Windows 7 64bits. I have clicked on 'setup.exe' and i have ran this module with the 'Administration Option'. It's works well but when 'setup.exe' ends, the directory C:\oraclexe\app\oracle\orada

  • Bounce Apps after iOS Update

    I'm using iPhone 5s with 32G and there is 7G free space.  After update iOS 7.1.2 at early July, the phone occasionally turned to blue screen during viewing photos or switching between apps or scrolling the screen, and back to the home screen in a whi

  • Email id through command line

    is there any way to create email id through command line?? please help me

  • How to identify the last changes made in the smartform ?

    Hi Form Experts, My smartform's General attribute shows that there is some change performed 2 months back, Which is not reflected in my production server. Could any one advice how to track the last performed changes in the system, I did not find vers

  • Nokia n95 wifi connect to the router no getway rep...

    i have nokia n95 i have a wofi router i want to connect my router ti using browsing when i connect the wifi to the router the message " no getway reply" so  i need to full configration so pls help Solved! Go to Solution.