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

Calling a SQL SP

Status
Not open for further replies.

MMund

Programmer
Oct 9, 2007
57
CA
I'm using VFP 9 to call a SQL Server 2005 SP.

I'm setting up an optiongroup with 4 radio buttons, containing the quarter ending dates for a year.

I'm sending the results of the selection to a variable

as follows:

Code:
local QtrEndDate as DateTime

DO CASE
			CASE THISFORM.optiongroup1.VALUE = 1
				QtrEndDate = CTOT("03/31/"+STR(curparameters.ye_processing_yyyy))
			CASE THISFORM.optiongroup1.VALUE = 2
				QtrEndDate = CTOT("06/30/"+STR(curparameters.ye_processing_yyyy))
			CASE THISFORM.optiongroup1.VALUE = 3
				QtrEndDate = CTOT("09/30/"+STR(curparameters.ye_processing_yyyy))
			CASE THISFORM.optiongroup1.VALUE = 4
				QtrEndDate = CTOT("12/31/"+STR(curparameters.ye_processing_yyyy))
			ENDCASE
			RetVal = SQLEXEC(m.lnconn,'exec cac_5yr_hist ?OtrEndDate')

I have a parameter QtrEndDate set up as a datetime in the SQL SP. The value of curparameters.ye_processing_yyyy is currently 2008.

The problem is that when I try to launch this, I am getting prompted to enter a value for QtrEndDate, even though I have just given it that. I even put a message box with the value of QtrEndDate right before the SQLEXEC, and it gave me the proper value.

TIA,

MMund
 
Should OtrEndDate be QtrEndDate?

I like work. It fascinates me. I can sit and look at it for hours...
 
Code:
local QtrEndDate as DateTime
DO CASE
   CASE THISFORM.optiongroup1.VALUE = 1
        [COLOR=red][b]Q[/b][/color]trEndDate = CTOT("03/31/"+STR(curparameters.ye_processing_yyyy))
   CASE THISFORM.optiongroup1.VALUE = 2
        [COLOR=red][b]Q[/b][/color]trEndDate = CTOT("06/30/"+STR(curparameters.ye_processing_yyyy))
   CASE THISFORM.optiongroup1.VALUE = 3
        [COLOR=red][b]Q[/b][/color]trEndDate = CTOT("09/30/"+STR(curparameters.ye_processing_yyyy))
   CASE THISFORM.optiongroup1.VALUE = 4
        [COLOR=red][b]Q[/b][/color]trEndDate = CTOT("12/31/"+STR(curparameters.ye_processing_yyyy))
 ENDCASE
 RetVal = SQLEXEC(m.lnconn,'exec cac_5yr_hist ?[COLOR=blue][b]O[/b][/color]trEndDate')

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top