Constrain for the data filed

Hi all,

Im trying to setup a constrain for the data filed that it should be equal or grater then 9/29/1904 and equal or less then todays date.

I created this method, it does not detect if date is less then 09/29/1904.

var str = application.getTimeStamp()
if (abc_date >= ‘9/29/1904’ && abc_date <= str)

{
return;
}

else
{
var Alert3 = plugins.dialogs.showInfoDialog(‘Attention’, 'ABC_ data filed should be equal or grater then 9/29/1904, and equal or less then todays date. ‘OK’);
return;
}

For some reason if you enter any date in the data filed we get ‘Attention’, ‘ABC_DATE must be between 9/29/1904 and todays date’,‘OK’
Dialog.

Thanks for any help.

Abrahim

I assume your ‘abc_date’ field is a datetime field.
A datetime field it will also have a time component.
Also application.getTimeStamp() returns a day name, date, time and timezone:

Mon May 23 09:18:14 CEST 2005

So you need to format that as well when used as a string to be able to use it in your condition.

Hope this helps.

Thanks Robert!

Abrahim