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

Problem with Parameters

Status
Not open for further replies.

michpaus

Programmer
Oct 18, 2005
11
US
I have a stored procedure that calls two parameters @Program which asks for a program code input and @MinPo which calls for a minimum Po Amount. The following is my stored procedure:
CREATE PROCEDURE MROProgramByDollar
(
@program varchar(4),
@MinPo money
)

AS

Select di1.vendor_code, di1.program, dpi.Po_num, dpi.date_create, mph.Printed_Date, mph.status, dpi.po_item_No, dpi.Supplier_pn, dpi.price, dpi.unit_of_meas,(dpi.quantity)*(dpi.price) as extd_cost,
dpi.quantity, (dpi.quantity)-(dpi.qty_recvd) as open_qty, dpi.baseline_date, dpi.[Current_Date], di1.nomenclature, di1.customer_no, di1.control_no, dpi.control_and_item,
dpi.last_expedite, di1.next_higher_assy, mph.Contract_no, dpi.need_date, dv.vendor_contact, dv.fax, dv.state, dv.vendor_name, dv.vendor_phone, ndx.group_no, ndx.key_value, ndx.date_update,
di1.disposition, di1.status,mph.ship_via, mph.status as po_status, di1.approval_status

from d_item1 di1
left outer join
(select Po_num, Date_create, po_item_no, supplier_pn, price, unit_of_meas, quantity,qty_recvd, max(baseline_date) as baseline_date, max([Current_Date]) as [Current_date],control_and_item,
sum(quantity)*(price) as extd_cost,need_date, last_expedite from d_poitem group by Po_num,Date_create, po_item_no, supplier_pn, price, unit_of_meas, quantity,qty_recvd, control_and_item,
quantity,price,need_date, last_expedite ) dpi on di1.control_and_item=dpi.control_and_item
left outer join m_pohead mph on dpi.po_num=mph.po_num
left outer join (select key_value, max(group_no) as group_no, max(date_update) as date_update from notes_dexpedite group by key_value) ndx on mph.po_num=ndx.key_value
left outer join d_vendors dv on di1.vendor_code=dv.vendor_code
where /*di1.vendor_code not like' ' and*/ (dpi.quantity)-(dpi.qty_recvd) >'0' and di1.approval_status='15' and di1.program=@program and (dpi.quantity)*(dpi.price)>=@MinPo
order by di1.vendor_code
GO

The problem that I am having is that when I run my crystal report and put in the value for both parameters i get the following error code

Query Engine Error: ADO Error Code : 0x80040e 10
Source: Microsoft OLE DB Provider for SQL Server
Description:procedure'MROProgramByDollar' expects parameter "@MinPO" which was not supplied
SQL State: 42000
Native Error: 201

Anyone have a clue as to why this is happening? Any help will be appreciated.

I am using Crystal reports v10


 
The only thing I can think of is that the Money type is confusing it, try changing it to a numeric.

-k

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top