By |
Locaction Of SQL Date Range Video |
beissner 10/19/2009 8:40:20 PM | Jeff I have run the various video's for the SQL operation.I have been unable to find which one houses the SQL DATE RANGE explanation. Would you please point me in right direction. Lots of great info in the videos. Thank You Fred
|
jeff 10/19/2009 11:18:37 PM | This one?
Calendar Control for Date Ranged Data Window queries http://www.JCapper.com/Podcasts/DateRangedDataWindowQueries.wmv" target="_blank
Of course that's for date ranged queries in Playlist file mode.
I don't recall whether or not I covered date ranged Data Window queries in SQL Mode in a video.
If your question is "How do I do date ranged Data Window queries in SQL Mode?" I do recall making a post in the JCapper 101 section a few weeks ago...
--quote:
Once you have data from the target folder sitting in the StarterHistory Table... just use sql to display it for a given date/time period.
Example, let's say for the sake of argument you have a SQL UDM with the following complete UDM Definition:
SELECT * FROM STARTERHISTORY WHERE RANKUPR = 1 AND RANKF01 <= 2 AND MLOR3 >= 1.7
...and you want to see how the UDM performed on a specific date... just add the following... No, not to the stored UDM Definition... just to the SQL Expression that you run through the Data Window:
AND YEAR = 2009 AND MONTH = 9 AND DAY(DATE) = 27
When you execute the sql expression the Data Window will pull records for the specific date 09/27/2009 only.
A little explanation...
YEAR is a field name in the table schema.
MONTH is also a field name in the table schema.
I put them there to facilitate having the Data Window show you results for specific time periods.
DATE is a field name in the table schema. It contains the race date in short date format like this:
mo/dy/year
In the above sql expression DAY is a function. The way that I used it tells the Data Window to first evaluate records in the DATE field... and pull only those records from the table where the DAY part (dy) is equal to 27.
--end quote--
I'll do one more example...
From the above it should be clear that you have three fields in the table to work with:
Year
Month
Date
Let's say you want to make the Data Window return results for the months of June 09, July 09, and August 09...
To do that, add something like the following to your SQL Expression:
AND YEAR = 2009 AND MONTH >= 6 AND MONTH <= 8
-jp
.
~Edited by: jeff on: 10/19/2009 at: 11:18:37 PM~
|
beissner 10/20/2009 7:42:01 AM | Jeff thank you. Fred
|