Database Handicapping Software- JCapper

JCapper Message Board

          JCapper 101
                      -- UDM Help

Home Register
Log In
By UDM Help
rosenowsr
5/13/2013
3:02:49 PM
Need help figuring out how to write SQL for top half of horses + 1 for any rank or gap category I choose.

Example: top half +1 of rank F03.

Thanks in advance.

Reply
jeff
5/13/2013
6:47:28 PM
As background info, here's a link to the techonthenet site where you will find an explanation of the CInt (convert integer) function:
http://www.techonthenet.com/access/functions/datatype/cint.php

With the needed background info out of the way, one way to get it done would be to use CInt to convert the result of fieldsize divided by 2 to an integer. From there add 1 to the result.

Here's an example:

AND RANKF03 <= CINT(FIELDSIZE / 2) + 1

Note: One way to test the above line for accuracy would be to TEMPORARILY add the following line to the expression:

AND FIELDSIZE = 8

From there, run it through the Data Window with the data broken out by SQL-F03 Rank. Since the entire results set will be limited to data for 8 horse fields only - when you see data for F03 ranks 1-5 only you will then know that "CINT(FIELDSIZE / 2) + 1" is working as intended.

Reminder: Don't forget to remove the temp line AND FIELDSIZE = 8 before saving the final UDM definition.



-jp

.




Reply
Reply

Copyright © 2018 JCapper Software              back to the JCapper Message Board              www.JCapper.com