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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Code HELP 2

Status
Not open for further replies.

BoniR

MIS
Joined
Mar 29, 2005
Messages
138
Location
US
Okay...I apologize if I am in the wrong forum...I need some help with an SQL statement if anyone has the time!
When running the query through Crystal Reports I am getting an Oracle error: 'ORA-00920' which I think means that I have an invalid operator somewhere...unfortunately I can not find it...any help would be appreciated!
Code:
select 
ch.company_id company,
substr(phys.last_name || ', ' || phys.first_name,1,25) physician,
phys.short_name physician_short,
phys.phys_id physician_idnum,
substr(p.last_name || ', ' || p.first_name,1,25) patient ,
p.patient_number pat_num,
substr(f.last_name || ', ' || f.first_name,1,25) guarantor,
'CHG' type,
ch.post_fromdate dos,
substr(substr(cp.procedure_code,1,5) || ch.Proc_modifier,1,9) cpt,
cp.proc_desc description,
ch.charge_amount charge_amount,
ch.remain_amount remain_amount,
ch.Date_entered entered,
substr(wu.last_name || ', ' || wu.first_name,1,20) user_name,
fc.description fin_class,
'1' transtype
from patient p, physician phys,family f, charge_history ch, 
company_procedure cp,westland_user wu,financial_class fc
where ch.company_id = {?Company}
and {?DateRangeType} >= {?StartDate}
and {?DateRangeType} < ( {?EndDate} + 1)
and cp.procedure_id = ch.procedure_id
and phys.phys_id = ch.physician_id
and p.patient_id = ch.patient_id
and p.active_yn = 'Y'
and p.company_id = ch.company_id
and f.family_id = p.family_id
and f.company_id = p.company_id
and wu.user_id = ch.Last_mod_user_id
and fc.financial_class_id = ch.financial_class_id_1
order by physician, patient,pat_num,dos,transtype
thanks again for any one who can help!
Boni

Boni J. Rychener
Hammerman Associates, Inc.
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
800-783-2269
 
try and remove the Where bits, and then add 1 by one.
When you get the error again you will have found the problem.

If without any of the where bits you still get the error then try and remove all but one of the selected fields, and then try adding one by one. same policy applies


but I would say the "?xxx) fields are the problem.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thank you so much!
I will try your suggestions!
Again-thank you!
Boni
:)

Boni J. Rychener
Hammerman Associates, Inc.
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
800-783-2269
 
I do suggest posting in an Oracle forum on this site.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top