One Star

[resolved] The cell format is not Date in row XXX error

Hi,
I have a Date column in my input excel sheet, in the format 16-nov-2011.
In the look up date table i have the date value in mm/dd/yyyy format. In the tmap i need to look up for the date from date table and i am using the following for that:-
TalendDate.formatDate("mm/dd/yyyy", inputSheet.Date)
When i run th job i am getting the following error :-
The cell format is not Date in row XXXX

If i don't specify the input.Date as Date type , it gives a different error which says TalendDate.formatDate() method is not applicable for (String,String) it has to be (String,Date)
Can anyone please help me on this?
Thanks,
Manju
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] The cell format is not Date in row XXX error

Sorry, the expression should be:
TalendDate.formatDate("MM/dd/yyyy", TalendDate.parseDate("dd-MMM-yy",row1.Date))
----------------------------------------------------------
Talend | Data Agility for Modern Business
11 REPLIES
One Star

Re: [resolved] The cell format is not Date in row XXX error

You can get that error "the cell format is not date..." when the date in the excel file is the result of a formula.
One Star

Re: [resolved] The cell format is not Date in row XXX error

Hi,
The date in the cell is hard coded it is not a result of any formula.
Thanks,
Manju
One Star

Re: [resolved] The cell format is not Date in row XXX error

Hi,
When i try this ,
TalendDate.formatDate("mm/dd/yyyy", TalendDate.parseDate("MM/DD/YYYY",row1.Date))
i am getting this error..
java.text.ParseException: Unparseable date: "28-Nov-11"
Can anyone please tell me how to rectify this?
Thanks,
Manju
One Star

Re: [resolved] The cell format is not Date in row XXX error

Please find the screen shot of the same attached.
Please guide me on how to rectify this problem.
Thanks,
Manju
One Star

Re: [resolved] The cell format is not Date in row XXX error

Hi,
Can anyone please help me on this issue please? Am stuck with this .

Many Thanks in advance,
Manju
Community Manager

Re: [resolved] The cell format is not Date in row XXX error

Hi
Try this expression:
TalendDate.formatDate("MM/dd/yyyy", TalendDate.parseDate("MM/dd/yy",row1.Date))
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] The cell format is not Date in row XXX error

Hi Shong,
when i tried this i got the following error :-
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "28-Nov-11"
I even tried the format dd-Mmm-yy yesterday , even that doesnt seem to work.
Please advise me on how to go about this.
Many Thanks,
Manju
Community Manager

Re: [resolved] The cell format is not Date in row XXX error

Sorry, the expression should be:
TalendDate.formatDate("MM/dd/yyyy", TalendDate.parseDate("dd-MMM-yy",row1.Date))
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] The cell format is not Date in row XXX error

Thanks Shong , that worked !!!!
One Star

Re: [resolved] The cell format is not Date in row XXX error

Hi, i have a source in excel file with date format like "MM-dd-yyyy"and "dd-MM-yyyy" now i have to get this source into target table . how to get it.
Iam getting the error like the cell format is not in date.........?
Six Stars

Re: [resolved] The cell format is not Date in row XXX error

Hi,
I am getting error like this "The cell format is not Date in ( Row. 1 and ColumnNum. 4 )" .Can anybody help me out