Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to create a new filed on the flue based on the existing one

Status
Not open for further replies.

estersita

Technical User
Aug 5, 2004
50
0
0
US
Dear Experts,

I am trying to create a column with values through the SELECT statement just adding 21 days:

SELECT DISTINCT
cde_proc,
i.cde_proc_mod,
i.num_pa_line_item ,
i.dte_received
stat.dsc_pa_status,
i.qty_unt_svc_ath,
i.qty_unt_svc_req,
i.dte_pa_auth_eff,
i.dte_pa_auth_end,
pauth.dte_received,
(pauth.dte_received +21) as dte_corn

FROM
TABLE1 i,
TABLE2 j,
etc...

.
.
t_pa_pauth pautH
WHERE dte_corn between '20180701' and '20180731'

I got the following message ...

ORA-00936: missing expression

What is wrong? Could you please correct me?

Thank you!
Estersita
 
if the dte_received is a string and not a date then use

Code:
SELECT DISTINCT
cde_proc,
i.cde_proc_mod,
i.num_pa_line_item ,
i.dte_received
stat.dsc_pa_status,
i.qty_unt_svc_ath,
i.qty_unt_svc_req,
i.dte_pa_auth_eff,
i.dte_pa_auth_end,
pauth.dte_received,
TO_CHAR((to_date(pauth.dte_received,'YYYYMMDD') +21),'YYYYMMDD') as dte_corn

FROM
TABLE1 i,
TABLE2 j,
etc...


Bill
Lead Application Developer
New York State, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top