nextensio list: how to add a calculated field?

piripacchio
Posts: 37
Joined: 2010-04-28 08:34

nextensio list: how to add a calculated field?

Post by piripacchio » 2010-05-21 11:53

Hi all,
I have a nextensio list displayng two datetime fields:
- start date
- end date

I would like to create a third column: flag, where the field value is 1 when the end date is < of the current date.

So, if today (20th may 2010) I have 3 records I would see this:

start_date - end_date - flag
01/05/2010 - 19/05/2010 - 1
01/05/2010 - 31/05/2010 - 0
01/06/2010 - 30/06/2010 - 0

I would like to be able to use filters too, so that I can easily select all expired records.

is there a simple way to do this with MX Koll pro?

TIA

tony

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: nextensio list: how to add a calculated field?

Post by Fred » 2010-05-21 22:44

No easy way to do this with the MX extentions. (Well not that I know of)

It is easy enough to achieve with a bit of hand coding.

First you need to decide how you are going to automate the update procedure.
If it is only a couple of records you can easily build an update function to check the dates of each record and flag it as expired and make it run every time you load the page.

If it is 1000's of records you will be better of coding the function in a separate page and run a daily cron job to update the field.

To filter on the list is simply a matter of building you list as usual and add a filter to the field.

rhjmartens
Posts: 1
Joined: 2010-08-04 11:33

Re: nextensio list: how to add a calculated field?

Post by rhjmartens » 2010-08-04 11:36

Why don't you calculate the field in the underlying SQL?
You can base the nextensio list on a recordset....

Post Reply