Pages:
Actions
  • #1 by mikejcshaw on 27 Nov 2017
  • Please can someone explain where I am going wrong with this expression. (I want to check if a race starts after 12:36 - I would expect the result in this example to be TRUE but it is FALSE). Thanks

    13:31:04Checking market "Horse Racing / GB / Kemp 27th Nov / 14:00 Kemp 27th Nov - 3m Mares Hrd".
    13:31:04Checking condition and Selection's Trigger Expression event_start_timestr is greater than 12:36:00.
    13:31:04Selection: Jers Girl, initial expr.: event_start_timestr, intermediate: 14:00:00, final: 14:00:00.
    13:31:04Selection: Jers Girl, initial expr.: 12:36:00, intermediate: 12:36:00, final: 12:36:00.
    13:31:04Selection: La Bague Au Roi, initial expr.: event_start_timestr, intermediate: 14:00:00, final: 14:00:00.
    13:31:04Selection: La Bague Au Roi, initial expr.: 12:36:00, intermediate: 12:36:00, final: 12:36:00.
    13:31:04Selection: Midnight Tour, initial expr.: event_start_timestr, intermediate: 14:00:00, final: 14:00:00.
    13:31:04Selection: Midnight Tour, initial expr.: 12:36:00, intermediate: 12:36:00, final: 12:36:00.
    13:31:04Selection: Rons Dream, initial expr.: event_start_timestr, intermediate: 14:00:00, final: 14:00:00.
    13:31:04Selection: Rons Dream, initial expr.: 12:36:00, intermediate: 12:36:00, final: 12:36:00.
    13:31:04Selection: Morello Royale, initial expr.: event_start_timestr, intermediate: 14:00:00, final: 14:00:00.
    13:31:04Selection: Morello Royale, initial expr.: 12:36:00, intermediate: 12:36:00, final: 12:36:00.
    13:31:04Selection: Treackle Tart, initial expr.: event_start_timestr, intermediate: 14:00:00, final: 14:00:00.
    13:31:04Selection: Treackle Tart, initial expr.: 12:36:00, intermediate: 12:36:00, final: 12:36:00.
    13:31:04Condition is: FALSE.
  • #2 by Oxa (WellDoneSoft) on 27 Nov 2017
  • Hello!

    event_start_timestr is a mere string, and you cannot compare a string to a date/time value.

    In your situation I would make use of the date/time variable event_start directly. The fractional part of this variable points at the time of the day, where .0 is midnight and 0.999999 is ~23:59. So to check if an event starts after 12:36, you will use this condition:

    Selection's Trigger Expression event_start - INTEGER(event_start) is greater than 0.525

    Here 0.525 corresponds to 12:36. To convert another time value, open Excel, insert the time value in a cell, e.g. 11:25:00, then right-click on the cell and choose "Format Cells". In the "Number" tab, choose the "Number" category.
Pages:
Actions