You are not logged in.
Announcement
Unanswered posts
|
Hi pedro
Thanks for your reply.But that's not what i want.
I want to output the result from tJavaRow.
In fact ,I write a function for datediff ,having a precision of day. Be different from java datediff, I need to keep the date and ignore the time.
My function:
public static long dateDiff(Date issueDate,Date originalInvoiceDate){
if (issueDate == null) {
issueDate = new Date(0);
}
if (originalInvoiceDate == null) {
originalInvoiceDate = new Date(0);
}
long day1 = issueDate.getTime()/1000/60/60/24;
long day2 = originalInvoiceDate.getTime()/1000/60/60/24;
long day = (day1-day2);
return day;
}
It always return a result with one day differnt from the result given by MS SQL datediff
Joe
Hi Joe
I have tested it and get correct results as the following images.
Check date pattern for each Date column.
Regards,
Pedro
Hi all
a test job as follow
tMSSqlInput—main—>tJavaRow
there are two datetime columns,whose date pattern are both 'yyyy-MM-dd HH:mm:ss.SSS'.
in tJavaRow:
print these two datetime columns.
Result :
Wed Dec 12 13:37:07 PST 2007
Tue Nov 27 20:03:30 PST 2007
It's not what i want.
I need a result with a format as 'yyyy-MM-dd HH:mm:ss.SSS'.
Is there anything wrong with my job?
BestRegards,
Joe