|
RJ
Starting Member
11 Posts |
Posted - 2011-06-23 : 16:45:17
|
| I have a Crystal report that obtains data via a stored procedure. The SP should also copy the selcted data into a new table. If I do no use a variable then the process works, however, once the variable is used I get an error message in Crystal "Failed to retrive data from the database".The variable in the SP is to prompt for the dates in Crystal. Can anyone assist me to overcome this problem.Here is a copy of the script:ALTER PROCEDURE [dbo].[A001_SVC_DATES](@StartDate Datetime,@EndDate Datetime) ASDROP TABLE SVCCRM.SVCREMselect cust.custno, cust.fname, cust.lname, cust.addr1, cust.addr2, cust.addr2e, cust.addr3, cust.po, cust.postcd,cust.email, cust.htel, cust.wtel, cust.tel3, cust.consent, cust.nocontact, vehi.licno, vehi.serialno, vehi.make, vehi.model, vehi.submodel,convert(varchar,vehi.fregd, 103) as RegDate,convert(varchar,vehi.nmd, 103) as NextSvcDate, convert(varchar,vehi.last_service, 103) as LastSvcDate,convert(varchar,vehi.ninspecday, 103) as NxtInspDate,convert(varchar,vehi.inspecd, 103) as LastInspDate,convert(varchar,vehi.next_emission_inspect, 103) as NxtEmiDate,convert(varchar,vehi.last_emission_inspect, 103) as LastEmiDateINTO SVCCRM.SVCREMfrom vehijoin cust on cust.custno = vehi.custnowhere nmd between @StartDate and @EndDate |
|