Re: [sqlite] Date arithmetic question

2008-01-18 Thread Paolo Vernazza
Fowler, Jeff wrote: Hello All, SQLite newbie here. I've looked through the email archives and website trying to find out how to compute the difference in months between two given dates. Each date is in -MM-DD HH:MM:SS format. The best I've been able to come up with seems rather ugly:

RE: [sqlite] Date arithmetic question

2008-01-18 Thread Tom Briggs
: RE: [sqlite] Date arithmetic question Guys, I guess I'm the newest SQLite person on this email list and I know I'm definitely the dumbest. It seems like a lot of you are trying to justify why two dates that are one minute apart can have a function say they're one month apart. Don't look

Re: [sqlite] Date arithmetic question

2008-01-18 Thread John Elrick
[EMAIL PROTECTED] wrote: Virgilio Fornazin [EMAIL PROTECTED] wrote: DATEDIFF should compute the difference by arithmetic subtracting M/Y in month case, if I'm not wrong ex: DateDiff (month, 1-1-2007, 3-30-2007) will return 2 Its that right ? So datediff('month', '2008-02-01

Re: [sqlite] Date arithmetic question

2008-01-18 Thread Rob Sciuk
On Thu, 17 Jan 2008, [EMAIL PROTECTED] wrote: Virgilio Fornazin [EMAIL PROTECTED] wrote: DATEDIFF should compute the difference by arithmetic subtracting M/Y in month case, if I'm not wrong ex: DateDiff (month, 1-1-2007, 3-30-2007) will return 2 Its that right ? So datediff('month',

RE: [sqlite] Date arithmetic question

2008-01-18 Thread Doug
] Date arithmetic question Guys, I guess I'm the newest SQLite person on this email list and I know I'm definitely the dumbest. It seems like a lot of you are trying to justify why two dates that are one minute apart can have a function say they're one month apart. Don't look at it that way

Re: [sqlite] Date arithmetic question

2008-01-17 Thread drh
Fowler, Jeff [EMAIL PROTECTED] wrote: Yes - I've looked over the current date functions. I would propose a single function addition that's hugely valuable in the business world. SQL Server has a function called datediff for date arithmetic. It accepts three parameters. The first indicates the

Re: [sqlite] Date arithmetic question

2008-01-17 Thread drh
Fowler, Jeff [EMAIL PROTECTED] wrote: Hello All, SQLite newbie here. I've looked through the email archives and website trying to find out how to compute the difference in months between two given dates. Each date is in -MM-DD HH:MM:SS format. The best I've been able to come up with

RE: [sqlite] Date arithmetic question

2008-01-17 Thread Fowler, Jeff
@sqlite.org Subject: Re: [sqlite] Date arithmetic question Fowler, Jeff [EMAIL PROTECTED] wrote: Hello All, SQLite newbie here. I've looked through the email archives and website trying to find out how to compute the difference in months between two given dates. Each date is in -MM-DD

Re: [sqlite] Date arithmetic question

2008-01-17 Thread Virgilio Fornazin
DATEDIFF should compute the difference by arithmetic subtracting M/Y in month case, if I'm not wrong ex: DateDiff (month, 1-1-2007, 3-30-2007) will return 2 Its that right ? A good reference for trying implementing it should be: http://www.sqlteam.com/article/datediff-function-demystified

RE: [sqlite] Date arithmetic question

2008-01-17 Thread Fowler, Jeff
- From: Scott Baker [mailto:[EMAIL PROTECTED] Sent: Thursday, January 17, 2008 3:13 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date arithmetic question Fowler, Jeff wrote: Yes - I've looked over the current date functions. I would propose a single function addition that's hugely

Re: [sqlite] Date arithmetic question

2008-01-17 Thread Scott Baker
Fowler, Jeff wrote: Yes - I've looked over the current date functions. I would propose a single function addition that's hugely valuable in the business world. SQL Server has a function called datediff for date arithmetic. It accepts three parameters. The first indicates the unit of scale

RE: [sqlite] Date arithmetic question

2008-01-17 Thread Noah Hart
Not really that goofy, just very specific. The SQL Server manual describes it this way: Returns the number of date and time boundaries crossed between two specified dates. Regards, Noah Hart -Original Message- So datediff('month', '2008-02-01 23:59:59','2008-01-31 00:00:00') should

Re: [sqlite] Date arithmetic question

2008-01-17 Thread Markus Hoenicka
[EMAIL PROTECTED] writes: So datediff('month', '2008-02-01 23:59:59','2008-01-31 00:00:00') should return 1 even though the difference is really only 1 second? Seems goofy to me well, this is one second rounded up to the next full month...If that is the kind of information you want

Re: [sqlite] Date arithmetic question

2008-01-17 Thread drh
. It computes the number of date measurement interval transitions that occur between the two dates. -Original Message- From: Markus Hoenicka [mailto:[EMAIL PROTECTED] Sent: Thursday, January 17, 2008 3:47 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date arithmetic question [EMAIL

RE: [sqlite] Date arithmetic question

2008-01-17 Thread Fowler, Jeff
:47 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date arithmetic question [EMAIL PROTECTED] writes: So datediff('month', '2008-02-01 23:59:59','2008-01-31 00:00:00') should return 1 even though the difference is really only 1 second? Seems goofy to me well, this is one second

Re: [sqlite] Date arithmetic question

2008-01-17 Thread drh
Virgilio Fornazin [EMAIL PROTECTED] wrote: DATEDIFF should compute the difference by arithmetic subtracting M/Y in month case, if I'm not wrong ex: DateDiff (month, 1-1-2007, 3-30-2007) will return 2 Its that right ? So datediff('month', '2008-02-01 23:59:59','2008-01-31 00:00:00')

Re: [sqlite] Date arithmetic question

2008-01-17 Thread P Kishor
PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date arithmetic question [EMAIL PROTECTED] writes: So datediff('month', '2008-02-01 23:59:59','2008-01-31 00:00:00') should return 1 even though the difference is really only 1 second? Seems goofy to me well

Re: [sqlite] Date arithmetic question

2008-01-17 Thread Gerry Snyder
[EMAIL PROTECTED] wrote: So datediff('month', '2008-02-01 23:59:59','2008-01-31 00:00:00') should return 1 even though the difference is really only 1 second? Seems goofy to me I have been staring at this until I'm getting goofy. Written as it is, isn't the time interval 1 second

Re: [sqlite] Date arithmetic question

2008-01-17 Thread drh
Gerry Snyder [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: So datediff('month', '2008-02-01 23:59:59','2008-01-31 00:00:00') should return 1 even though the difference is really only 1 second? Seems goofy to me I have been staring at this until I'm getting goofy.

RE: [sqlite] Date arithmetic question

2008-01-17 Thread Fowler, Jeff
this would be useful for some of us. We do have a vested interest in the product! - Jeff From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thu 1/17/2008 9:21 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date arithmetic question Gerry Snyder