Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Impossible query
Message
 
To
17/02/2003 03:28:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00752198
Message ID:
00754034
Views:
30
>Sorry, The error problem is solved ! I had joined the 'INNER JOIN' statement !
>However, my code still does not do what I want it to. Any suggestions anyone ?
>
>Steve

Hi Steve,

Let me try to add my 2 Eurocents here. It seems to me that what you miss in your database structure is the ending date (i'll refer to it as date2) of the period for which a specific wage level is valid.

First there is the possibility to add a field to your table. When the wage changes, you would access the currently valid entry and set the end date to the day before the new wage becomes valid. At creation of a new record (i.e. when a wage changes) this date should be set as far as possible in the future.

Having such a field would allow you to access the wage rate table with a simple SQL WHERE clause somethinglike (WHERE work.date BETWEEN wage.date1 AND wage.date2.

If adding this field (and going through the process of assigning the values in the currently existing table) is not an option then you will have to compute date2 at query time. Basically this consists of generating a cursor that contains both dates and the wage, associated with the entity (gang?) that executed the work.

This kind of operation (of generating an end date) is to the best of my knowledge only doable via a SCAN ENDSCAN through the table that is ordered by person, date1 descending, and storing date1-1 in the date2 field of the next record (i.e. chronologically the previous one).

Hope this helps.

Marc

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform