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
#
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.
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 math outside the string
>
..@sqlite.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 su
#>> 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 + " & ((
#>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
Rick Ratchford
wrote:
> Unfortunately, I have to take the examples provided and convert them
> into
> STRINGS that Visual Basic 6 can use.
>
> Here is that string from your earlier example:
>
> sSQL = "SELECT Date, Month, Day, Open, High, Low, Close FROM [" &
> gsTableName & "] " & "WHERE ((Month
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 to be
>> 100 - any number
atement jump out as the issue?
Thanks. :)
Rick
#>-Original Message-
#>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
#>boun...@sqlite.org] On Behalf Of Igor Tandetnik
#>Sent: Monday, October 12, 2009 6:53 AM
#>To: sqlite-users@sqlite.org
#>Subjec
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.
Ig
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
>
#>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 T
Rick Ratchford wrote:
> Okay, I give.
>
> What do the 100 and 1300 values signify? I am completely baffled at
> how you
> arrived at these values and what they do.
I simply combine (month, day) pair into a single number - the same way you
combine two digits of a decimal number by multiplying th
Tandetnik
#>Sent: Friday, October 09, 2009 6:46 PM
#>To: sqlite-users@sqlite.org
#>Subject: Re: [sqlite] Need Help SQL
#>
#>Rick Ratchford
#>> Data Fields: ID, Date, Month, Day, Year, Price
#>>
#>> Problem: When provided the starting Month/Day numbers, and ending
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
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
> data):
>
> In other wor
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 data)
17 matches
Mail list logo