# Warning converting clover type: date to sql type: DATE

**URL:** <https://forum.cloverdx.com/t/warning-converting-clover-type-date-to-sql-type-date/1838>\
**Category:** CloverDX Platform\
**Created:** [March 16, 2017, 12:00am UTC](https://forum.cloverdx.com/t/warning-converting-clover-type-date-to-sql-type-date/1838 "2017-03-16T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wills\_aperio](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@wills\_aperio](https://forum.cloverdx.com/u/wills_aperio)\
**Post date:** [March 16, 2017, 12:00am UTC](https://forum.cloverdx.com/t/warning-converting-clover-type-date-to-sql-type-date/1838/1 "2017-03-16T00:00:00Z")

</div>

hi,

i’m trying to clear a warning in DBOutputTable…

i’m passing in data from a ComplexDataReader, my metadata has a field “lot\_date” of type date, to a postgres table with a matching column. but i’m receiving a warning:

> Invalid SQL query. Incompatible types - field lot\_date, clover type: date, sql type: DATE

it’s the same error message whether i map it via DB Table/Field mapping

```auto
$account:=account;$lot_number:=lot_number;$lot_date:=lot_date;

```

or i just use the sql query

```auto
INSERT INTO "tlh_test"."clover__import_table" ("account", "lot_number", "lot_date") VALUES ($account, $lot_number, $lot_date)

```

or

```auto
INSERT INTO "tlh_test"."clover__import_table" ("account", "lot_number", "lot_date") VALUES ($account, $lot_number, ($lot_date)::date)

```

it actually runs correctly in all of the above configurations, but continues to warn me. any thoughts on how i can make it happy?  
thanks!

designer v. 4.4.0.011  
postgres v. 9.5

---

<div class="post-metadata">

**Author:** ![svecp](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@svecp](https://forum.cloverdx.com/u/svecp)\
**Post date:** [March 17, 2017, 12:51am UTC](https://forum.cloverdx.com/t/warning-converting-clover-type-date-to-sql-type-date/1838/2 "2017-03-17T00:51:18Z")

</div>

Hi,

I came across exactly the same thing a while back, wondering what is wrong. The answer is actually in PostgreSQL documentation - PostgreSQL’s DATE is a plain date information without any notion about the time. CloverETL’s date is on the other hand essentially timestamp. The warning basically means, you’re losing precision when you try to insert into a database.

So how to fix it? Easily, either set your database field to TIMESTAMP, or…

Open your metadata and select the field which is causing problems. On the right hand side of the dialog (when you scroll down a tiny bit) is a “Format” option. There is a heuristic which determines what kind of information given field is suppose to carry.

- If you leave it blank (i.e. set to default), it is basically exactly the same as you’d set format to DATE & TIME - engine will check against TIMESTAMP data type in your database

- If you set DATE only format, your database is going to be checked against DATE data type

- If you set TIME only format, your database is going to be checked against TIME data type

Hope this helps.

---

<div class="post-metadata">

**Author:** ![wills\_aperio](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@wills\_aperio](https://forum.cloverdx.com/u/wills_aperio)\
**Post date:** [March 17, 2017, 4:13pm UTC](https://forum.cloverdx.com/t/warning-converting-clover-type-date-to-sql-type-date/1838/3 "2017-03-17T16:13:39Z")

</div>

hi pavel,

thanks for the tip. the designer ui shows “_yyyy-MM-dd_” as the default setting in the metadata for the date’s format so i assumed that was what it was going to do. as you say, when i actually changed it to “yyyy-MM-dd” the warning went away.

cheers!
