Author Topic: Problem with event_start_timestr  (Read 2759 times)

Tags:
  • All members
  • Posts: 110
Problem with event_start_timestr
« on: 27 Nov 2017, 13:36 »
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.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: Problem with event_start_timestr
« Reply #1 on: 27 Nov 2017, 21:40 »
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.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

 

Please note, BetFair is seems to be currently OFFLINE