Re: Subtracting date fields

2004-01-30 Thread Aftab Jahan Subedar
try SELECT id,(TO_DAYS(firstdate)- TO_DAYS(postdate)) AS diff FROM calendar well you have to put the bigger date on the lhs. Kenneth Letendre wrote: Hello, I'm trying to get the difference (in days) between dates stored in two date fields. My query: SELECT id,(firstdate- postdate) AS diff

Re: Subtracting date fields

2004-01-09 Thread Ryan Yagatich
On Sat, 2004-01-31 at 14:57, Kenneth Letendre wrote: > Hello, > >I'm trying to get the difference (in days) between dates stored in two > date fields. >My query: > > SELECT id,(firstdate- postdate) AS diff FROM calendar > >This works fine if the two dates are in the same month, but

Re: Subtracting date fields

2004-01-07 Thread David Precious
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Saturday 31 January 2004 7:57 pm, Kenneth Letendre wrote: > Hello, > >I'm trying to get the difference (in days) between dates stored in two > date fields. You should be able to do this with the TO_DAYS() function, e.g.: SELECT ID, (TO_DAYS(fi

Re: Subtracting date fields

2004-01-03 Thread robert_rowe
Just try to access the databases with the permissions that you had previously set up. If you can then it worked okay. If you can't then use grant to set your permissions up again. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysq

Re: Subtracting date fields

2004-01-01 Thread Matt W
ings to be portable to different systems, I suggest using things compatible with 3.23. And when you have to use something that's not, handle it in your code. Matt - Original Message - From: "Bob Terrell" <[EMAIL PROTECTED]> Sent: Thursday, January 01, 2004 5:35 PM Subje

RE: Subtracting date fields

2004-01-01 Thread stairwaymail-mysql
endar Dan -Original Message- From: Matt W [mailto:[EMAIL PROTECTED] Sent: Thursday, January 01, 2004 4:42 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Subtracting date fields Dan, DATEDIFF() only works in MySQL 4.1.1+. RTFM! ;-) Matt - Original Message - From: <[EM

Re: Subtracting date fields

2004-01-01 Thread Matt W
Dan, DATEDIFF() only works in MySQL 4.1.1+. RTFM! ;-) Matt - Original Message - From: <[EMAIL PROTECTED]> Sent: Wednesday, December 31, 2003 2:10 PM Subject: RE: Subtracting date fields > Kenneth, > > try > > SELECT id, DATEDIFF(firstdate, postdate) AS

Re: Subtracting date fields

2003-12-31 Thread Scott Haneda
on 01/31/2004 11:57 AM, Kenneth Letendre at [EMAIL PROTECTED] wrote: > Hello, > > I'm trying to get the difference (in days) between dates stored in two > date fields. > My query: > > SELECT id,(firstdate- postdate) AS diff FROM calendar > > This works fine if the two dates are in the same m

RE: Subtracting date fields

2003-12-31 Thread stairwaymail-mysql
Kenneth, try SELECT id, DATEDIFF(firstdate, postdate) AS diff FROM calendar RTFM! hope that helps, dan -Original Message- From: Kenneth Letendre [mailto:[EMAIL PROTECTED] Sent: Saturday, January 31, 2004 1:51 PM To: [EMAIL PROTECTED] Subject: Subtracting date fields Hello, I&#

Subtracting date fields

2003-12-31 Thread Kenneth Letendre
Hello, I'm trying to get the difference (in days) between dates stored in two date fields. My query: SELECT id,(firstdate- postdate) AS diff FROM calendar This works fine if the two dates are in the same month, but not otherwise. MySQL appears to be treating the two dates as base-10 int

Subtracting date fields

2003-12-31 Thread Kenneth Letendre
Hello, I'm trying to get the difference (in days) between dates stored in two date fields. My query: SELECT id,(firstdate- postdate) AS diff FROM calendar This works fine if the two dates are in the same month, but not otherwise. MySQL appears to be treating the two dates as base-10 int