Select Statement Between 2 times Field in Dynamics ax

hi all,

i have a field, time in my table that save times,

07:00:00 am

08:00:00 am

01:36:02 pm

12:00:00 am

01:42:36 pm

11:43:20 pm

Now i want to get range between this records, for example between 07:00:00 and 09:00:00 in select statement

how can i to this?

Just use > and < operators in the WHERE clause.

If the type is time, not utcDateTime, note that its saved as the number of seconds since midnight, therefore 7 am = 76060.

hi martin

thanks for help, but i wrote this code in the button , this not work probably :

select * from InventQuarantineOrder where
InventQuarantineOrder.My_Time > TimeEdit1.value() && InventQuarantineOrder.My_Time<= TimeEdit2.value();

how to change My_Time to UtcDateTime?

Using the time of day alone is not enough - you have to specify a date, such as the current date.

Use DateTimeUtil class for that, e.g. DateTimeUtil::newDateTime(systemDateGet(), TimeEdit1.value(), DateTimeUtil::getUserPreferredTimeZone()).