You need to explain better what you're trying to do. First issue is that this is not a date. It may, of course, mean something to wherever you're trying to put it...
Hi,
Apparently he wants to insert a default value in the date field...I want to do the same thing but it does not work ...
I want to insert a default value in my date field because null values are not allowed in that field
is there a way to do that ?
Thanks,
Rajaa
Hi,
Do a trick
In the date field subtract two date current date from current date you will get all 0000-00-00. Use expression to check if the input date is null then do above operation.
Thanks
Vaibhav
you can do it using two way.
1:- TalendDate.compareDate(date1, date2)
the result wheather two date is the same, if first one less than second one return number -1,
equlas return number 0,
bigger than return number 1.
{example} compareDate(2008/11/24 12:15:25, 2008/11/24 16:10:35) return -1 #
2:-TalendDate.diffDate(date1, date2, dateType)
a number of years, months, days ... date1 - date2
{examples} ->>
diffDate(2008/11/24 12:15:25, 2008/10/14 16:10:35, "yyyy") : return 0
->> diffDate(2008/11/24 12:15:25, 2008/10/14 16:10:35, "MM") : return 1
->> diffDate(2008/11/24 12:15:25, 2008/10/14 16:10:35, "dd") : return 41
Hi thanks for your reply , i just want to get the "0000-00-00" (return type is date) at the end to insert it in my field , how can i do that ? "here is my script but it's not working : TalendDate.parseDate("dd-MM-yyyy",String.valueOf((TalendDate.diffDate(TalendDate.getCurrentDate(),TalendDate.getCurrentDate()))))