Re: [sqlite] Need Help SQL

2009-10-13 Thread Rick Ratchford
Thanks! Cheers! #>-Original Message- #>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- #>boun...@sqlite.org] On Behalf Of sub sk79 #>Sent: Monday, October 12, 2009 9:35 PM #>To: General Discussion of SQLite Database #>Subject: Re: [sqlite] Need Help SQL #

Re: [sqlite] Need Help SQL

2009-10-12 Thread sub sk79
Hi!, Here is a non-math version using PL/SQL date operators and functions available in StepSqlite (https://www.metatranz.com/stepsqlite/). Hopefully this should be easier to follow. You can compile the below code directly to a win32 dll on the StepSqlite website and then use it in your VB code.

Re: [sqlite] Need Help SQL

2009-10-12 Thread Igor Tandetnik
Rick Ratchford wrote: > Your code: > > ((:EndMonth - :StartMonth) * 100 + (:EndDay - :StartDay) + 1300) % > 1300 > > VB: > > (" & lngEndMth - lngStartMth) & ") * 100 + " & ((lngEndDay - > lngStartDay) + 1300) Mod 1300 > > In the VB version, I'm simply doing all the

Re: [sqlite] Need Help SQL

2009-10-12 Thread RB Smissaert
org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rick Ratchford Sent: 12 October 2009 20:16 To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Need Help SQL #>Doesn't your VB SQLite binding support parameterized statements? If so, #>I'd suggest you dump it and find a b

Re: [sqlite] Need Help SQL

2009-10-12 Thread Rick Ratchford
#>> Here is that string from your earlier example: #>> #>> sSQL = "SELECT Date, Month, Day, Open, High, Low, Close FROM [" & #>> gsTableName & "] " & "WHERE ((Month - " & lngStartMth & ")*100 + (Day #>> - " & #>> lngStartDay & ") + 1300) % 1300 <= " & lngEndMth - lngStartMth & " * #>> 100 + " &

Re: [sqlite] Need Help SQL

2009-10-12 Thread Rick Ratchford
#>Doesn't your VB SQLite binding support parameterized statements? If so, #>I'd suggest you dump it and find a better one. #> #>Igor Tandetnik I'm not up on the terminology. I'm using Olaf Schmidt's VB SQLite binder. He'd probably be better to answer this question than I. :-) Rick

Re: [sqlite] Need Help SQL

2009-10-12 Thread Igor Tandetnik
Rich Shepard wrote: > On Sun, 11 Oct 2009, Igor Tandetnik wrote: > >> I simply combine (month, day) pair into a single number - the same >> way you combine two digits of a decimal number by multiplying the >> first by 10 and adding the second. The multiplier doesn't have

Re: [sqlite] Need Help SQL

2009-10-12 Thread Rich Shepard
On Sun, 11 Oct 2009, Igor Tandetnik wrote: > I simply combine (month, day) pair into a single number - the same way you > combine two digits of a decimal number by multiplying the first by 10 and > adding the second. The multiplier doesn't have to be 100 - any number > greater than 31 will do.

Re: [sqlite] Need Help SQL

2009-10-12 Thread Igor Tandetnik
Rick Ratchford wrote: > #>There is a slight complication with the case where endDate < > startDate, #>where you want to wrap around to next year. For that, I > simply need to #>perform calculations modulo a large number - any > number greater than the #>representation of 12/31 in my scheme. 1300 >

Re: [sqlite] Need Help SQL

2009-10-11 Thread Rick Ratchford
#>There is a slight complication with the case where endDate < startDate, #>where you want to wrap around to next year. For that, I simply need to #>perform calculations modulo a large number - any number greater than the #>representation of 12/31 in my scheme. 1300 is one such number. #> #>Igor

Re: [sqlite] Need Help SQL

2009-10-11 Thread Rick Ratchford
Tandetnik #>Sent: Friday, October 09, 2009 6:46 PM #>To: sqlite-users@sqlite.org #>Subject: Re: [sqlite] Need Help SQL #> #>Rick Ratchford <r...@amazingaccuracy.com> #>> Data Fields: ID, Date, Month, Day, Year, Price #>> #>> Problem: When provided the star

Re: [sqlite] Need Help SQL

2009-10-09 Thread Rick Ratchford
Thank you Igor. I will. :-) Cheers! Rick #>-Original Message- #>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- #>boun...@sqlite.org] On Behalf Of Igor Tandetnik #>Sent: Friday, October 09, 2009 6:46 PM #>To: sqlite-users@sqlite.org #>Subject: Re: [sql

Re: [sqlite] Need Help SQL

2009-10-09 Thread Igor Tandetnik
Rick Ratchford > Data Fields: ID, Date, Month, Day, Year, Price > > Problem: When provided the starting Month/Day numbers, and ending > Month/Day numbers, what is the correct way to SQL the database so > that the recordset created returns as follows (assume 4 years of

[sqlite] Need Help SQL

2009-10-09 Thread Rick Ratchford
I'm trying to correctly word an SQL statement. Data Fields: ID, Date, Month, Day, Year, Price Problem: When provided the starting Month/Day numbers, and ending Month/Day numbers, what is the correct way to SQL the database so that the recordset created returns as follows (assume 4 years of