# Transform language and Dates

**URL:** <https://forum.cloverdx.com/t/transform-language-and-dates/56>\
**Category:** CloverDX Platform\
**Created:** [July 16, 2007, 12:00am UTC](https://forum.cloverdx.com/t/transform-language-and-dates/56 "2007-07-16T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldforum](https://avatars.discourse-cdn.com/v4/letter/o/13edae/32.png) [@oldforum](https://forum.cloverdx.com/u/oldforum)\
**Post date:** [July 16, 2007, 12:00am UTC](https://forum.cloverdx.com/t/transform-language-and-dates/56/1 "2007-07-16T00:00:00Z")

</div>

I am trying to merge 2 inputs together each one has an activity\_date field and i want to have the most recent date to come out of the merge. the code i am using is

date activity\_date;  
if ($table1.activity\_date \> $table2.activity\_date) {  
activity\_date = $table1.activity\_date;  
}  
else {  
activity\_date = $table2.activity\_date;  
}

the dates in the tables are in yyyy-mm-dd hh:mm:ss format and in the destination table the field is the same. however when i run the graph the date entered in the final table loses the time data and is in yyyy-mm-dd 12:00:00 AM format how cna i fix this

---

<div class="post-metadata">

**Author:** ![oldforum](https://avatars.discourse-cdn.com/v4/letter/o/13edae/32.png) [@oldforum](https://forum.cloverdx.com/u/oldforum)\
**Post date:** [July 16, 2007, 8:23am UTC](https://forum.cloverdx.com/t/transform-language-and-dates/56/2 "2007-07-16T08:23:44Z")

</div>

well i found out what it is. MS SQL Server does not like the default date form of Tue Nov 28 16:16:48 EST 2006.

---

<div class="post-metadata">

**Author:** ![oldforum](https://avatars.discourse-cdn.com/v4/letter/o/13edae/32.png) [@oldforum](https://forum.cloverdx.com/u/oldforum)\
**Post date:** [July 16, 2007, 8:23am UTC](https://forum.cloverdx.com/t/transform-language-and-dates/56/3 "2007-07-16T08:23:45Z")

</div>

Hi !

Can you try to use print\_err() to show what value is actually in activity\_date after the if statement ?

It should contain date&time info. Question is how is it defined on the “final table” side - do you mean output data file or database table.

If database table, then the DB data type may not support time information.

If clover data file (text file) then it depends on the metadata - you should have it with format specified and it must contain time - something like this “yyyy-MM-dd HH:mm:ss”
