Simplicty and flexibility!


Developer Tips - How to create a datetime field in DataEase.

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

Developer Tips - How to create a datetime field in DataEase.

With different countries and different standards date and time is not straightforward. DataEase use the Windows Time and Date and that result in a lot of peculiarities.

To insure that you have a correct sortable and indexable DataTime in your forms is a good insurance against any of these peculiarities.

So creating a text field that contain a datetime that will always be higher as time and dates progress is a good idea.

As a good design rule you should include two fields in all of your tables:

UniqueID, text 16, indexed and unique with derivation UniqueID() 

and

DateTime, text 12, indexed with the following derivation:



concat(lastc(concat("00",year(current date)),2),lastc(concat("00",month(current date)),2),lastc(concat("00",day(current date)),2),lastc(concat("00",hours(current time)),2),lastc(concat("00",minutes(current time)),2),lastc(concat("00",seconds(current time)),2))



This derivation will insure that you get the correct positioned datetime for your tables.


Written by DataEase 23/02/15 at 14:50:35 Dataease [{8}]FIVE