Arnaud de Montard writes:

>> Le 29 août 2016 à 15:34, Benedict, Tom 
>> <[email protected]<mailto:[email protected]>> a écrit :
>>
>> 4D does support the datetime data type when the field is created using
>> SQL commands. [...]

>if a date field is created with legacy tools, can it be used it as a datetime?
>And an hour field?


Apparently so:

C_DATE($dOutput)
C_TIME($dtOutput)

  // Misc is a table created using 4D legacy tool (structure editor)

$sKey:="DateTime Test"
Begin SQL
     insert into Misc (sKey, dDate) VALUES (:$sKey, CURRENT_TIMESTAMP());

     select dDate from Misc where sKey = :$sKey into :$dOutput -- yields the 
date part: 08/31/16
End SQL

Begin SQL
     select dDate from Misc where sKey = :$sKey into :$dtOutput  -- yields the 
time part:  07:24:00
End SQL

So my statement about needing to create the field with SQL commands is not 
correct. If you fill a date field using SQL time stamp 4D will store both the 
date and time parts either of which may be retrieved using SQL, no matter how 
the date field was created.

BTW, my testing is in v 13.5 interpreted. I have not tested compiled.

Tom Benedict
Optum
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to