Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with date based index
Message
From
11/11/2001 20:02:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Help with date based index
Miscellaneous
Thread ID:
00580327
Message ID:
00580327
Views:
60
Hi

I am developing an work order system. Each product/Service has a price based on the effective date (i.e. the price becomes effective on a certain date)

I wrote the following function in the 'Stored Procedures' section for the database. WOTS.dbc

PROCEDURE relCurrPrice
LPARAMETERS cPrSched, cPcode
*
* find the current price in price schedule = cPrSched
* for product/service = cPcode
*
LOCAL cSeekKey
cSeekKey = cPrSched+cPcode+STR({^3000/01/01}-DATE())
cSaveAlias=ALIAS()

SELECT SPECPRICE
SET ORDER TO 1 && PRSCHED+CODE+STR({^3000/01/01}-EFFDATE)
cSaveFilter = FILTER()
SET FILTER TO prsched=cPrsched AND code=cPcode

lFound=INDEXSEEK(cSeekkey,.T.)
IF !lFound
SKIP -1
IF EOF()
lFound = .F. && No record for this Pcode
ELSE
lFound = .T. && We are on the current price
ENDIF
ENDIF
* Restore entry state
SET FILTER TO &cSaveFilter
SELECT (cSaveAlias)

RETURN lFound
ENDPROC

**********************
I added the parent 'PRODSERV' and child 'SPECPRICE' tables and
set the RelationExpression to 'relCurrPrice(prsched,code)'

I then added some test fields from each table to a test form.

The relationship expression gets fired and finds the correct record
but I then get an 'error 67' 'expression evaluator failed' in 'DataEnvironment.OpenTables' method.

Obviously I am doing something wrong. can someone please point me in the correct direction.

Ta very muchly
Geoff Scott
May all your weeds be wildflowers
Next
Reply
Map
View

Click here to load this message in the networking platform