Database Handicapping Software- JCapper

JCapper Message Board

          JCapper 101
                      -- Deleting records - StarterHistory table

Home Register
Log In
By Deleting records - StarterHistory table
jeff
1/9/2013
7:53:55 PM
--Quote:
"

> Hi Jeff,
>
> Database work (StartHistory table populations) is going much better since our latest phone call.
>
> In one of my quarterly folders I must have had a few files from the next quarter, so when I ran a Build using Mode 4, those few dates were added to the StarterHistory table.
>
> I can remove these few date records from the StarterHistory table now, then let them get properly added when performing a Build (Mode 4) on the next quarter of data. (The NEXT quarter of data has not been built at all yet, so that is why I know I can use mode 4.). Of course, if I do nothing now, then Build the next quarter, I will end up with duplicate records for these few race dates.
>
> Remind me again of the SQL command syntax to remove specific records. I remember it had a date component.
>
> Thanks!


"

--End Quote.




Suppose for the sake of argument you had duplicate records for GPX race cards beginning Jan 01, 2013 through Jan 03, 2013 (inclusive.)

The following sql command can be keyed into the Data Window's sql expression tool and would work:

DELETE * FROM STARTERHISTORY WHERE TRACK = 'GPX' AND [DATE] BETWEEN #01-01-2013# AND #01-03-2013#

Important points:

1. The date field needs to be wrapped in square brackets like this: [DATE]

2. The text of dates referred to in the sql expression should be wrapped in pound signs like this: #01-01-2013#

3. You will be prompted by the Data Window interface each time you key a delete command. After confirming YES that you actually do want to delete records, the interface will execute your sql expression - deleting all records specified by your sql expression.

4. Note that the example sql expression for multiple race cards provided above isn't the only way you could do this. If you wanted to, you could write individual sql expressions designed to delete the records of a single race card from the table and execute them one at a time. For Example: DELETE * FROM STARTERHISTORY WHERE TRACK = 'GPX' AND [DATE] = #01-01-2013#


-jp



.

~Edited by: jeff  on:  1/9/2013  at:  7:53:55 PM~

Reply
jeff
1/9/2013
11:25:22 PM
See also the section beneath the header labeled "DELETING TABLE RECORDS USING THE DATA WINDOW" towards the bottom of the JCapper SQL Cheat Sheet at the following link:
JCapper SQL Cheat Sheet


-jp

.



Reply
Reply

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