Hi Jim,

I could alter the program that populates the Date/Time Column to the format you 
specify.  I'm trying real hard not to as that program has been in use for many 
years and it would be a significant undertaking to convert the program then 
convert the existing data.  Not saying I won't do it as I'm at that point, just 
wondering if it's possible to avoid that route.

If I converted the date/time field, would it be easier to create counts?

If you could, would you be able to offer a sample Select statement I can alter 
to fit my needs?  

Thank you very much for the reply!

Side note, I'll be visiting Disney in July!

Regards,

-Ron

-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Jim Callahan
Sent: Tuesday, April 11, 2017 9:15 PM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

Can you convert the dates to ISO 8601 date time format?
https://en.wikipedia.org/wiki/ISO_8601

YYYY-MM-DD hh:mm:ss

ISO date strings (when zero filled) are sortable which necessarily includes 
comparable (Java speak).
By "zero filled" I mean for March you have "03" and not just "3".

Then if you could generate/populate the boundary values in ISO format; the 
comparisons would be straightforward and you could avoid the julian date 
conversion.

Another disadvantage of Julian dates are the different base years used by 
applications including Unix, MS Access, MS Excel for Windows and MS Excel for 
MacIntosh. Each application is internally consistent, but the minute you 
exchange data between applications...
https://support.microsoft.com/en-us/help/214330/differences-
between-the-1900-and-the-1904-date-system-in-excel

Your specification actually requires day counts; so you may need Julian dates 
after all.

Jim Callahan
Orlando, FL



On Tue, Apr 11, 2017 at 7:24 PM, Ron Barnes <rbar...@njdevils.net> wrote:

> Hello all,
>
> To everyone who helped me before - thank you very much!
>
> I'm coding in Visual Basic .NET (Visual Studio 2015) Community.
>
> I have to count a Date/Time field and the problem is, this field 
> contains data in a format I'm not sure can be counted.
>
> I need to count all the dates in the field but the dates are a 
> combined Date and time in the format examples below.
> My goal is to use the current Date/time ('NOW') and calculate the time 
> difference in days, from my DB Sourced field.
>
> I need to capture...
> Less than 1 month old
> 1 month old
> 2 months old
> 1 year old.....
> all the way to greater than 10 years old.
>
> Is this even possible in SQLite and if so, how would I go about doing it?
>
> I have been googling a few queries and come up blank.
>
> I try this code and differing combinations of it but it always returns 
> NULL.
>
> SELECT CAST
> ((datetime(julianday(datetime('now'))) - JulianDay(VI_Creation_Date)) 
> As
> Integer)
> FROM Volume_Information
>
> Here is what I have to work with.
>
> Table Name:
> Volume_Information
>
> Column name:
> VI_Creation_Date
>
> Date Format:
> MM/DD/CCYY HH:MM:SS AM/PM
>
> Examples:
>
> 10/30/2015 2:28:30 AM
> 2/13/2016 7:51:04 AM
> 5/15/2016 12:06:24 PM
> 10/7/2016 1:27:13 PM
>
> Any Help would be greatly appreciated,
>
> Thanks,
>
> -Ron
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to