Page 1 of 1

nextensio list: how to add a calculated field?

Posted: 2010-05-21 11:53
by piripacchio
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

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

Posted: 2010-05-21 22:44
by Fred
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.

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

Posted: 2010-08-04 11:36
by rhjmartens
Why don't you calculate the field in the underlying SQL?
You can base the nextensio list on a recordset....