Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2012
    Posts
    4

    Unanswered: ORA-00936 Missing Expression.

    Can somebody help me with the query below. I am getting ORA-00936 Missing Expression.

    SELECT COUNT(*)
    FROM PPC_RECON INNER JOIN COSMOS_LZ_COSMOS_PPC_T
    ON (PPC_RECON.PPC_LAST_UPD_DATE = CDATE(COSMOS_LZ_COSMOS_PPC_T.PPC_LAST_UPD_DATE))
    AND (PPC_RECON.PPC_LAST_UPD_TIME = COSMOS_LZ_COSMOS_PPC_T.PPC_LAST_UPD_TIME)
    AND (PPC_RECON.PPC_CONTRACT_NBR = COSMOS_LZ_COSMOS_PPC_T.PPC_CONTRACT_NBR)
    AND (PPC_RECON.PPC_SITE_ID = COSMOS_LZ_COSMOS_PPC_T.PPC_SITE_ID)
    WHERE (((CDate([COSMOS_LZ_COSMOS_PPC_T].[PPC_LAST_UPD_DATE]))>=CDate('2012-06-22') And (CDate([COSMOS_LZ_COSMOS_PPC_T].[PPC_LAST_UPD_DATE]))<=CDate('2012-06-28')));

    Thanks,
    Srinath

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    AFAIK, square barckets "[]" are not part of SQL language standard
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2012
    Posts
    4
    I took of the square bracket and still getting the same error.
    Is there something else I am missing here?

    Thanks

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Is there something else I am missing here?
    consider to Read The Fine Manual below
    Contents

    I don't know about you, but I can not debug code I can not see.
    Since we don't have your tables or data, we can not run, test, debug or improve posted statement.
    Consider post CREATE TABLE statements for all tables in query.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    Unless you have a user defined function named "cdate", If you do not then "cdate" is not a oracle function, I believe it's a VB Script function.

    This might work for you, it's according to what the data type of the columns your comparing are:
    Code:
    select count(*)
     from  ppc_recon inner join cosmos_lz_cosmos_ppc_t on trunc( ppc_recon.ppc_last_upd_date )  =  trunc( cosmos_lz_cosmos_ppc_t.ppc_last_upd_date )
                                                      and ppc_recon.ppc_last_upd_time           =  cosmos_lz_cosmos_ppc_t.ppc_last_upd_time
                                                      and ppc_recon.ppc_contract_nbr            =  cosmos_lz_cosmos_ppc_t.ppc_contract_nbr
                                                      and ppc_recon.ppc_site_id                 =  cosmos_lz_cosmos_ppc_t.ppc_site_id
    where  trunc( cosmos_lz_cosmos_ppc_t.ppc_last_upd_date ) between to_date( '2012-06-22','yyyy-mm-dd' )
     and                                                             to_date( '2012-06-28','yyyy-mm-dd' )


    You can determine the data type of the date/time columns:
    Code:
    select atc.table_name, atc.column_name, atc.data_type as "type", atc.data_length as "length",
           atc.data_precision as "precision", atc.data_scale as "scale", atc.nullable, acc.comments
     from  sys.all_tab_columns atc left outer join sys.all_col_comments acc on atc.owner        =  acc.owner
                                                                           and atc.table_name   =  acc.table_name
                                                                           and atc.column_name  =  acc.column_name
    where  atc.table_name  in( 'PPC_RECON', 'COSMOS_LZ_COSMOS_PPC_T' )
     and   atc.column_name in( 'PPC_LAST_UPD_DATE', 'PPC_LAST_UPD_TIME' )
    order by atc.table_name, atc.column_id

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •