Re: mysql friendly dates

2012-04-17 Thread william drescher
On 4/16/2012 3:04 PM, Haluk Karamete wrote: What's the right built in php date function formatting would be to take a simple date, that's in a format like 05/16/1960 and turn it into a mysql datetime datatype friendly format? I don't mind H M S to be as 00:00:00/ wrote my own: function US2ISODa

Re: operation with dates

2011-05-13 Thread Hal�sz S�ndor
2011/05/13 09:46 -0500, Dan Nelson Datediff isn't portable, either :) What of the date arithmetic is? I looked at it, and saw beside much that it was MySQL extension. But at least a function of fixed arguments looks like any other function; there is hope of writing one. The IN

Re: operation with dates

2011-05-13 Thread Dan Nelson
In the last episode (May 12), Halßsz Sßndor said: > 2011/05/12 13:06 -0500, Dan Nelson > In the last episode (May 12), Rocio Gomez Escribano said: > > I found it, > > > > mysql> select userID from user where datediff(now(), userPaymentDate)< 365; > > This can be made more readable by

Re: operation with dates

2011-05-13 Thread Hal�sz S�ndor
2011/05/12 13:06 -0500, Dan Nelson In the last episode (May 12), Rocio Gomez Escribano said: > I found it, > > mysql> select userID from user where datediff(now(), userPaymentDate)< 365; This can be made more readable by using mysql's INTERVAL syntax. And less portable

Re: operation with dates

2011-05-12 Thread Dan Nelson
In the last episode (May 12), Rocio Gomez Escribano said: > I found it, > > mysql> select userID from user where datediff(now(), userPaymentDate)< 365; This can be made more readable by using mysql's INTERVAL syntax. It can also be made more efficient by moving userPaymentDate out of the functi

RE: operation with dates

2011-05-12 Thread Rocio Gomez Escribano
ensaje original- De: Andrew Moore [mailto:eroomy...@gmail.com] Enviado el: jueves, 12 de mayo de 2011 17:11 Para: Rocio Gomez Escribano CC: mysql@lists.mysql.com Asunto: Re: operation with dates Rocio, there are specific date functions that you need to learn to allow you to complete this kind of

Re: operation with dates

2011-05-12 Thread Andrew Moore
trying to subtract two dates in my consult, but I don’t get it, > I did: > > > > > > > > mysql> select userID from user where (userPaymentDate - now()) < 365 ; > > > > > > It didn’t work. Do you know how to do it? Thank you so much! > >

operation with dates

2011-05-12 Thread Rocio Gomez Escribano
Hello! I’m trying to subtract two dates in my consult, but I don’t get it, I did: mysql> select userID from user where (userPaymentDate - now()) < 365 ; It didn’t work. Do you know how to do it? Thank you so much! Regards Rocío Gómez Escribano <mail

counting between dates across number of tables

2010-10-31 Thread William Hamilton
I have three tables show below which I am querying in a number of ways. e.g. I have a report which lists number of reports provided compaired to number which were due over the duration of the project. I am puzzling over how to select the reports which were due and were delivered during a week base

Re: Selecting Dates

2010-02-03 Thread Paul DuBois
On Jan 31, 2010, at 7:35 PM, ML wrote: > Hi All, > > Switching from Oracle to MySQL, I seem to be having some difficulty selecting > dates using between or even where >= and <= like: > > SELECT * FROM orders WHERE order_date BETWEEN='2010-01-01' AND '

Re: Selecting Dates

2010-02-01 Thread ML
Jim, > Shouldn't it be: > SELECT * FROM orders WHERE order_date >= '2010-01-01' AND order_date <= > '2010-01-30' ORDER BY order_date; > > ? > > change the "=>" and repeat the column_name. Datetime should be datetime or > timestamp; Spot on. Thank you for the clarification, obviously a syntax

Re: Selecting Dates

2010-02-01 Thread Jim Lyons
: > Hi > What is the datatype of the column order_date. Give the full form of the > date for the between condition. > > Thanks > Suresh Kuna > MySQL DBA > --Original Message-- > From: ML > To: mysql@lists.mysql.com > Subject: Selecting Dates > Sent:

Re: Selecting Dates

2010-02-01 Thread sureshkumarilu
Hi What is the datatype of the column order_date. Give the full form of the date for the between condition. Thanks Suresh Kuna MySQL DBA --Original Message-- From: ML To: mysql@lists.mysql.com Subject: Selecting Dates Sent: Feb 1, 2010 7:05 AM Hi All, Switching from Oracle to MySQL, I

Re: Selecting Dates

2010-02-01 Thread Lucky Wijaya
__ From: ML To: mysql@lists.mysql.com Sent: Mon, February 1, 2010 8:35:01 AM Subject: Selecting Dates Hi All, Switching from Oracle to MySQL, I seem to be having some difficulty selecting dates using between or even where >= and <= like: SELECT * FROM orders WHERE order_date BETWEE

Selecting Dates

2010-02-01 Thread ML
Hi All, Switching from Oracle to MySQL, I seem to be having some difficulty selecting dates using between or even where >= and <= like: SELECT * FROM orders WHERE order_date BETWEEN='2010-01-01' AND '2010-01-30' ORDER BY order_date; or SELECT * FROM orders WHERE ord

getting repeating events between two dates

2009-11-03 Thread Ramsey, Robert L
y date with an event like this: 2009-11-02 Test Event 1 2009-11-05 Test Event 1 2009-11-09 Test Event 1 2009-11-12 Test Event 1 2009-11-16 Test Event 1 2009-11-19 Test Event 1 2009-11-23 Test Event 1 2009-11-26 Test Event 1 And of course any other dates with other events that either repeat or not. Is there a way to do that or am I better off just using php and looping through every day in the range? Thanks! Bob

SQL statement to populate Start and End dates Everyday with an Interval of certain day(s)

2009-08-28 Thread sAvEOUrplAnEt
I had the following fields for my calendar: start_date = "08/01/09" (starts on) end_date = "08/31/09" (ends on) the_length = "1" (everyday) repeat_every = "2" (with an interval of 2 days) Now, I want to use SQL statement to populate "daily" but with an interval of "2" days, star

Re: Are dates stored as String? Or Integer?

2009-01-29 Thread Martijn Tonies
27;m using Delphi and internally it represents dates as float so using integers will speed up the Delphi code. But the main slow down I have is with executing the queries. The dates are used in the indexes, sorting, and in a few table joins. So is there a speed advantage of switching the dates t

Re: Are dates stored as String? Or Integer?

2009-01-28 Thread Paul DuBois
er is going to speed the queries up. I'm using Delphi and internally it represents dates as float so using integers will speed up the Delphi code. But the main slow down I have is with executing the queries. The dates are used in the indexes, sorting, and in a few table joins. So is there

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread Michael Dykman
For the DATE type, the comparisons are performed aginst raw binary data as an integer would be. I read your first post too hastily and thought you were proposigng to store dates as string. (don't laugh, I have seen this done by people who should know better). I don't think you ar

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread mos
ger is going to speed the queries up. I'm using > Delphi and internally it represents dates as float so using integers will > speed up the Delphi code. But the main slow down I have is with executing > the queries. The dates are used in the indexes, sorting, and in a few table > joins.

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread Michael Dykman
ueries up. I'm using > Delphi and internally it represents dates as float so using integers will > speed up the Delphi code. But the main slow down I have is with executing > the queries. The dates are used in the indexes, sorting, and in a few table > joins. So is there a speed advant

Are dates stored as String? Or Integer?

2009-01-27 Thread mos
ng Delphi and internally it represents dates as float so using integers will speed up the Delphi code. But the main slow down I have is with executing the queries. The dates are used in the indexes, sorting, and in a few table joins. So is there a speed advantage of switching the dates to inte

Re: Optimizing nullable expiration dates

2008-11-17 Thread Real Estate
Hi, I am getting copies of your email...I don't know why...Can you fix this problem.. Kind regards, Matthew - Original Message - From: "Mark Goodge" <[EMAIL PROTECTED]> To: "mysql" Sent: Monday, November 17, 2008 10:14 AM Subject: Re: Optim

Re: Optimizing nullable expiration dates

2008-11-17 Thread Mark Goodge
Norman Elton wrote: I've got a table that tracks expiration dates. Currently, if the record hasn't expired, the column is stored as NULL. In order to find records that haven't expired, I search for "WHERE expire_at > NOW() OR expire_at IS NULL". This seems dirt

Optimizing nullable expiration dates

2008-11-17 Thread Norman Elton
I've got a table that tracks expiration dates. Currently, if the record hasn't expired, the column is stored as NULL. In order to find records that haven't expired, I search for "WHERE expire_at > NOW() OR expire_at IS NULL". This seems dirty, and I suspect it mak

date list including dates not in the list

2008-01-29 Thread Weston, Craig (OFT)
Hi there, I have a list of events that occur periodically: 1/1/2008Event 1/1/2008Event 1/1/2008Event 1/2/2008Event 1/2/2008Event 1/4/2008Event 1/4/2008Event I know how to count events per day, but on

RE: ordering dates

2007-09-12 Thread Jerry Schwartz
ulford [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 12, 2007 4:49 PM > To: mysql@lists.mysql.com > Subject: ordering dates > > $result= mysql_query("SELECT date_format(date, '%d/%m/%Y') as > date, title, > id, display FROM news ORDER BY date DESC "); >

Re: ordering dates

2007-09-12 Thread Philip Hallstrom
$result= mysql_query("SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM news ORDER BY date DESC "); I have the query above the problem is oders them like so 30/05/2007 29/07/2007 25/0/2007 The order is taken by the first number. Is there any way to order them properly wit

Re: ordering dates

2007-09-12 Thread Michael Dykman
May I suggest: SELECT date_format(date, '%d/%m/%Y') as mydate, title, id, display FROM news ORDER BY date DESC changing the alias of your formatted date to mydate, the raw value of date is now available to order by. - michael dykman On 9/12/07, Ross Hulford <[EMAIL PROTECTED]> wrote: > $resul

ordering dates

2007-09-12 Thread Ross Hulford
$result= mysql_query("SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM news ORDER BY date DESC "); I have the query above the problem is oders them like so 30/05/2007 29/07/2007 25/0/2007 The order is taken by the first number. Is there any way to order them properly wit

Re: Searching for Dates

2007-03-20 Thread Bob Cooper
> >> >> data I need from my tables without any issues but his one has > >> >> stumped me. > >> >> > >> >> I am trying to query data associated with specific dates. The > >> >> dates are not sequential but somewhat sporadic. I wo

Re: Searching for Dates

2007-03-18 Thread Jim Ginn
the >> >> data I need from my tables without any issues but his one has >> >> stumped me. >> >> >> >> I am trying to query data associated with specific dates. The >> >> dates are not sequential but somewhat sporadic. I would like to >>

Re: Searching for Dates

2007-03-18 Thread Dan Nelson
tables without any issues but his one has > >> stumped me. > >> > >> I am trying to query data associated with specific dates. The > >> dates are not sequential but somewhat sporadic. I would like to > >> query out data/dates that are every 4 days fro

Re: Searching for Dates

2007-03-18 Thread Jim Ginn
b Cooper said: >> I am working with MySQL ver 5.1 on a Ubuntu Linux x86_64. I am new to >> both SQL and MySQL. I have been able to query out most of the data I >> need from my tables without any issues but his one has stumped me. >> >> I am trying to query data associate

Re: Searching for Dates

2007-03-17 Thread Dan Nelson
g to query data associated with specific dates. The dates > are not sequential but somewhat sporadic. I would like to query out > data/dates that are every 4 days from a starting date. > > 2006-4-17, 2006-4-21, etc. > > I have tried ADDDATE('2006-4-14',interval 4 day)<=Date_

Searching for Dates

2007-03-17 Thread Bob Cooper
Hi, I am working with MySQL ver 5.1 on a Ubuntu Linux x86_64. I am new to both SQL and MySQL. I have been able to query out most of the data I need from my tables without any issues but his one has stumped me. I am trying to query data associated with specific dates. The dates are not sequential

Re: return all dates between two dates

2007-02-26 Thread Peter Brawley
able. PB Bryan Cantwell wrote: I need to create an inline view that will give me all dates between two specified. Here is the question posed to me that I need to answer: This basic query gets me the last 6 hours of history table entries for an item, grouped into minutes (if an item has a delay

return all dates between two dates

2007-02-26 Thread Bryan Cantwell
I need to create an inline view that will give me all dates between two specified. Here is the question posed to me that I need to answer: This basic query gets me the last 6 hours of history table entries for an item, grouped into minutes (if an item has a delay of 5 seconds, it takes the max

RE: Getting number days between 2 dates

2007-02-05 Thread Jerry Schwartz
06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: Duncan Hill [mailto:[EMAIL PROTECTED] > Sent: Monday, February 05, 2007 7:33 AM > To: mysql@lists.mysql.com > Subject: Re: Getting number days between 2 dates > > On Sunday 04 February 2007 17:

Re: Getting number days between 2 dates

2007-02-05 Thread Duncan Hill
On Sunday 04 February 2007 17:24:29 Jim MacDiarmid wrote: > I've been trying to figure this out using the CURDATE() function, but I > keep getting a syntax error. Below is the code I'm using: > > SELECT > `vb_links`.`DateAdded` > FROM > `vb_links` > WHERE DATEDIFF( CURDATE() , `vb_links`.`DateAdded

RE: Getting number days between 2 dates

2007-02-04 Thread Jim MacDiarmid
om: Mike Blezien [mailto:[EMAIL PROTECTED] > Sent: Saturday, April 01, 2006 1:25 PM > To: [EMAIL PROTECTED]; mysql@lists.mysql.com > Subject: Re: Getting number days between 2 dates > > thx's Keith, another option :) > > Mike > - Original Message - > F

BC Dates

2006-11-17 Thread Philip G. Duffy
I can't find how to handle B.C. dates.  I am not concerned about the Julian to Gregorian cutover issue, and I simply need to be able to represent dates such as the birth and death of Aristotle, 384-322 B.C.. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mys

Bug in 4.1.21 with "between" comparing datetime and dates?

2006-09-13 Thread Pete Harlan
I just filed bug #22317 about this. The following script fails to return a row under 4.1.21 (on x86_64, anyway), but works correctly on 4.1.20 (and .18): drop table if exists test1; create table test1 ( datetimeval datetime, dateval1 date, dat

Re: dates in mysql

2006-08-23 Thread Chris
Visolve DB Team wrote: hi MySQL automatically converts a date or time type value to a number (numeric context) & viceversa. When the server starts, it attempts to determine the time zone of the host machine and uses it to set the *system_time_zone* system variable. The value does not chang

Re: dates in mysql

2006-08-23 Thread Visolve DB Team
he environment in which the server runs. Thanks ViSolve DB Team - Original Message - From: "Chris" <[EMAIL PROTECTED]> To: Sent: Wednesday, August 23, 2006 8:11 AM Subject: dates in mysql > Hi all, > > Does anyone know how mysql stores dates? > > I'

dates in mysql

2006-08-22 Thread Chris
Hi all, Does anyone know how mysql stores dates? I'm wondering whether it converts it back to UTC before storing it (and back to the client timezone setting when you select) or whether it leaves it "as is" with the timezone information. So to change to a different timez

Re: How to create a table of dates?

2006-08-10 Thread Peter Brawley
>So if the date range is '2001-01-15' to '2003-04-01' then it would generate >approx 800 rows with dates between these 2 ranges. I can't seem to figure >out how to do it without writing a program. See Dates/'Make a calendar table at http://www.artfulso

How to create a table of dates?

2006-08-10 Thread mos
This one has me puzzled. All I need to do is create a table of dates, one date per row, from a starting to ending date. So if the date range is '2001-01-15' to '2003-04-01' then it would generate approx 800 rows with dates between these 2 ranges. I can't seem to

Re: Fun with Dates and Incentives.

2006-05-26 Thread sheeri kritzer
riginal Message- From: sheeri kritzer [mailto:[EMAIL PROTECTED] Sent: Thursday, May 25, 2006 9:13 AM To: Brian Menke Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Fun with Dates and Incentives. Brian, MySQL's timestamp function is based on the *server*'s timestamp,

Re: Fun with Dates and Incentives.

2006-05-26 Thread Jeff Shapiro
On Wednesday 24 May 2006 15:18, Brian Menke scribble on about: > Peter, thanks for the detailed info. I will figure out how to get rid of > the UNIQUE key. Somehow that got added. Thanks for the catch. As far as INT > for student id goes, I'm using email because it will be unique, and offers > an e

Re: Fun with Dates and Incentives.

2006-05-26 Thread Jeff Shapiro
On Wednesday 24 May 2006 15:18, Brian Menke scribble on about: > Peter, thanks for the detailed info. I will figure out how to get rid of > the UNIQUE key. Somehow that got added. Thanks for the catch. As far as INT > for student id goes, I'm using email because it will be unique, and offers > an e

Re: Fun with Dates and Incentives.

2006-05-25 Thread Peter Brawley
kritzer [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 25, 2006 9:13 AM To: Brian Menke Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Fun with Dates and Incentives. Brian, MySQL's timestamp function is based on the *server*'s timestamp, not the client's. -Sheeri On 5/24/0

RE: Fun with Dates and Incentives.

2006-05-25 Thread Brian Menke
ROTECTED] Sent: Thursday, May 25, 2006 9:13 AM To: Brian Menke Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Fun with Dates and Incentives. Brian, MySQL's timestamp function is based on the *server*'s timestamp, not the client's. -Sheeri On 5/24/06, Brian Menke <

Re: Fun with Dates and Incentives.

2006-05-25 Thread sheeri kritzer
S! -Brian _ From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 24, 2006 3:56 PM To: Brian Menke Cc: mysql@lists.mysql.com Subject: Re: Fun with Dates and Incentives. Brian, CURRENT_TIMESTAMP gives you time in your server's timezone. UTC_TIMESTAMP gives GM (univer

RE: Fun with Dates and Incentives.

2006-05-24 Thread Brian Menke
olves huge problems for me and I seriously owe you! I'm gonna do some more research so I understand how this works. THANKS! -Brian _ From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 24, 2006 3:56 PM To: Brian Menke Cc: mysql@lists.mysql.com Subject: Re: Fun

Re: Fun with Dates and Incentives.

2006-05-24 Thread Peter Brawley
awley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 24, 2006 1:31 PM To: Brian Menke Cc: mysql@lists.mysql.com Subject: Re: Fun with Dates and Incentives.   Brian Re your schema,   --it's redundant to define PRIMARY and UNIQUE keys on the same column,   --why not an INT

Re: Fun with Dates and Incentives.

2006-05-24 Thread Peter Brawley
Brian, Somehow the server ate my response... Re your schema, --it's redundant to define PRIMARY and UNIQUE keys on the same column, --why not an INT student id? --what if two (eg married) students share an email account? --comparing datetimes across multiple time zones will be simpler if you

RE: Fun with Dates and Incentives.

2006-05-24 Thread Brian Menke
ian _ From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 24, 2006 1:31 PM To: Brian Menke Cc: mysql@lists.mysql.com Subject: Re: Fun with Dates and Incentives. Brian Re your schema, --it's redundant to define PRIMARY and UNIQUE keys on the same column, --why not

Re: Fun with Dates and Incentives.

2006-05-24 Thread Peter Brawley
and relationships already all set up for the tests, but it's the tracking of the dates and times that I don't have and it got me thinking. I need to track down to the day/hour/minute level. Okay, that should be easy (I think). I'm going to need to do a lot of date/time c

Re: Fun with Dates and Incentives.

2006-05-24 Thread Jason Dimberg
time the student takes the test and show the latest score ect. You get the idea. I have the database tables and relationships already all set up for the tests, but it's the tracking of the dates and times that I don't have and it got me thinking. I need to track down to the day/ho

RE: Fun with Dates and Incentives.

2006-05-24 Thread George Law
TECTED] > Sent: Wednesday, May 24, 2006 12:51 PM > To: mysql@lists.mysql.com > Subject: Fun with Dates and Incentives. > > I'm hoping for some general advice on an approach for the following > scenario: > > > > I have a customer who wants to put an incenti

Fun with Dates and Incentives.

2006-05-24 Thread Brian Menke
re of 100%... that type of thing. Students are allowed to take test more than once. Track each time the student takes the test and show the latest score ect. You get the idea. I have the database tables and relationships already all set up for the tests, but it's the tracking of the dates and ti

Re: Select a value between dates.

2006-04-12 Thread gerald_clark
George Law wrote: This brings up a question I was asked... Which is more efficient? Select . where date between '-mm-dd hh:mm:ss' and '-mm-dd hh:mm:ss' This one. Or Select . where unix_timestamp(date) between unix_timestamp('-mm-dd hh:mm:ss') and unix_timest

RE: Select a value between dates.

2006-04-12 Thread George Law
This brings up a question I was asked... Which is more efficient? Select . where date between '-mm-dd hh:mm:ss' and '-mm-dd hh:mm:ss' Or Select . where unix_timestamp(date) between unix_timestamp('-mm-dd hh:mm:ss') and unix_timestamp('-mm-dd hh:mm:ss')

Fw: Select a value between dates.

2006-04-12 Thread Rhino
TECTED]> Sent: Wednesday, April 12, 2006 2:00 PM Subject: Re: Select a value between dates. >From: "Rhino" <[EMAIL PROTECTED]> To: "H L" <[EMAIL PROTECTED]>, Subject: Re: Select a value between dates. Date: Tue, 11 Apr 2006 16:35:15 -0400 - Original Me

Re: Select a value between dates.

2006-04-11 Thread Rhino
- Original Message - From: "H L" <[EMAIL PROTECTED]> To: Sent: Tuesday, April 11, 2006 4:05 PM Subject: Select a value between dates. I am far from an mysql expert... but is there a way to select between dates in a table and check if a value exists in all fields b

Select a value between dates.

2006-04-11 Thread H L
I am far from an mysql expert... but is there a way to select between dates in a table and check if a value exists in all fields between dates. If one day between those dates cannot be booked i dont want to get it in my SUM resultset. I want to calculate Sum between those dates and i one idea

Re: Getting number days between 2 dates

2006-04-01 Thread Mike Blezien
thx's Keith, another option :) Mike - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Saturday, April 01, 2006 10:52 AM Subject: Re: Getting number days between 2 dates Use SELECT DATEDIFF('new_date', 'old_date'); mysql> SELECT

Re: Getting number days between 2 dates

2006-04-01 Thread mysql
y and practice are the same; in practice they are not. On Sat, 1 Apr 2006, Rhino wrote: > To: Mike Blezien <[EMAIL PROTECTED]>, > Jorrit Kronjee <[EMAIL PROTECTED]>, mysql@lists.mysql.com > From: Rhino <[EMAIL PROTECTED]> > Subject: Re: Getting number days b

Re: Getting number days between 2 dates

2006-04-01 Thread Rhino
- Original Message - From: "Mike Blezien" <[EMAIL PROTECTED]> To: "Jorrit Kronjee" <[EMAIL PROTECTED]>; Sent: Saturday, April 01, 2006 9:00 AM Subject: Re: Getting number days between 2 dates Jorrit, - Original Message - From: "Jo

Re: Getting number days between 2 dates

2006-04-01 Thread Jorrit Kronjee
Mike Blezien wrote: Jorrit, - Original Message - From: "Jorrit Kronjee" <[EMAIL PROTECTED]> To: Sent: Saturday, April 01, 2006 7:46 AM Subject: Re: Getting number days between 2 dates Mike Blezien wrote: Hello, I'm sure this is a simple query but haven&

Re: Getting number days between 2 dates

2006-04-01 Thread Mike Blezien
Jorrit, - Original Message - From: "Jorrit Kronjee" <[EMAIL PROTECTED]> To: Sent: Saturday, April 01, 2006 7:46 AM Subject: Re: Getting number days between 2 dates Mike Blezien wrote: Hello, I'm sure this is a simple query but haven't come up with a g

Re: Getting number days between 2 dates

2006-04-01 Thread Jorrit Kronjee
Mike Blezien wrote: Hello, I'm sure this is a simple query but haven't come up with a good approach. Need to get the number of days between two dates. IE: today's date: (2006-04-01 - 2006-03-05) need to calculate the number of days between these dates.. what is the best que

Getting number days between 2 dates

2006-04-01 Thread Mike Blezien
Hello, I'm sure this is a simple query but haven't come up with a good approach. Need to get the number of days between two dates. IE: today's date: (2006-04-01 - 2006-03-05) need to calculate the number of days between these dates.. what is the best query statement to accompl

Re: MySQL and dates puzzle

2005-10-28 Thread Michael McFadden
exisiting record (ER). In this case both NR and > ER would have start > dates and end dates so intermediate calculations are > avoided (speed > boost). > > If the ER is scheduled to finish BEFORE The start of > the NR, it the > situation looks like this: > > fig a

Re: MySQL and dates puzzle

2005-10-28 Thread SGreen
h an exisiting record (ER). In this case both NR and ER would have start dates and end dates so intermediate calculations are avoided (speed boost). If the ER is scheduled to finish BEFORE The start of the NR, it the situation looks like this: fig a. ER: |

Re: {Spam?} MySQL and dates puzzle

2005-10-27 Thread ddevaudreuil
. Scheidecker Antunes" <[EMAIL PROTECTED]> 10/27/2005 05:31 PM To mysql@lists.mysql.com cc Subject {Spam?} MySQL and dates puzzle Hello all, I have a TA table to record TA UNAVAILABLE times. This table is quite simple. It has a TAID number, a start date and an end date. tbl_sc

Re: MySQL and dates puzzle

2005-10-27 Thread Michael McFadden
-27 17:00:00','2005-10-27 18:00:00' > > Each ta can have more than one entry per day. He > might be a busy TA and > have a lot > of meetings scheduled. The meetings do not have to > be 1 hour length, > they can be 5 or 10 minutes. > So something like

MySQL and dates puzzle

2005-10-27 Thread C.F. Scheidecker Antunes
'2005-10-27 17:05:00','2005-10-27 17:10:00' Now, I need to check, given a start and end dates, if that would overlap with some record already present in the database. If I want to know if the TA is busy between 17:30 and 18:10 I could I issue something like this: SELECT coun

Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Michael Stassen
Dan Tappin wrote: I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and

Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Dan Tappin
I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and then LEFT JOIN my

Re: SELECT question - query for records over a series of dates

2005-08-16 Thread Michael Stassen
| +---+-+ Now I can manipulate the data afterwards (i.e. look for empty rows via PHP where this is going to end up...) but it would be much easier to get the data direct from MySQL. Is there any (easy) way to do this in MySQL? Dan T Add a table: CREATE TABLE `dates` (`date` DATE

Re: SELECT question - query for records over a series of dates

2005-08-16 Thread Daniel Kasak
Dan Tappin wrote: I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I a

SELECT question - query for records over a series of dates

2005-08-16 Thread Dan Tappin
I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I am stuck on a creativ

Re: Dates & Schedule Problems

2005-08-16 Thread Gleb Paharenko
Hello. I was able to make a query which retrieves dates where the TA is available only for specific TA. To list all TA and periods of time where they're available I wrote a stored procedure which works in MySQL 5. Here is the definition and test data in my tbl_notavailable

Re: Dates & Schedule Problems

2005-08-14 Thread Peter Brawley
CF, >tbl_NotAvailable { > TAid - int(11) > StartDate - DateTime > EndDate - DataTime >} >Question one: >Now, how can I return a calendar of the dates where the TA is AVAILABLE, >that is the oposite of what is recorded? You may be better off with an explicit c

Re: Dates & Schedule Problems

2005-08-14 Thread Jasper Bryant-Greene
C.F. Scheidecker Antunes wrote: Question one: Now, how can I return a calendar of the dates where the TA is AVAILABLE, that is the oposite of what is recorded? I want a list of all the available days and times by substracting the non available times recorded in the table. I guess I would need

Dates & Schedule Problems

2005-08-14 Thread C.F. Scheidecker Antunes
13:30 there will be an entry on his table like (001,2005-08-15 12:00,2005-8-16 13:30) where 001 is the TA Id. Question one: Now, how can I return a calendar of the dates where the TA is AVAILABLE, that is the oposite of what is recorded? I want a list of all the available days and times by

Re: Stored Procedure, Dates, and Between

2005-08-09 Thread Kent Roberts
Now that I think about it, if MySql forced declaration of session variables it would avoid some nasty bugs in SPs. >>> Mark Matthews 08/09/05 08:46AM >>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kent Roberts wrote: > I have a simple SP that is selecting rows based on a date range using param

Re: Stored Procedure, Dates, and Between

2005-08-09 Thread Kent Roberts
Sorry, I'll try and proof reed more karefullly in the futchure. :-) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Stored Procedure, Dates, and Between

2005-08-09 Thread Kent Roberts
That's it. Thanks Mark. I think I was confusinged by MS SQL Server syntax which prefixes both session variables and parameters with @. And you're right Scott, I changed the name of the SP for posting simplicity and forgot to change the colling statement to match. Thanks a lot both of you for gettin

Re: Stored Procedure, Dates, and Between

2005-08-09 Thread SGreen
datetime) > BEGIN > SELECT * > FROM mitlog > WHERE (mitlog.StartDateTime between @begDate And @endDate); > END$$ > - > > and compiles ok. The calling statement looks like this: > > call spPatientsLikeUsersByDate ('2005-04-01

Re: Stored Procedure, Dates, and Between

2005-08-09 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kent Roberts wrote: > I have a simple SP that is selecting rows based on a date range using > parameters. I've tried several permutations that all return 0 rows. > > The select statement looks like this: > > select * from 'mit_log'.'mitlog' where St

Stored Procedure, Dates, and Between

2005-08-09 Thread Kent Roberts
The calling statement looks like this: call spPatientsLikeUsersByDate ('2005-04-01','2005-04-07') Like I said, I've tried several guesses at syntax with no luck. When I take out the parameters and hard code the dates, it works. Any ideas? Thanks in advance, Kent in Montana -- MySQL G

Re: SELECT by date plus get both next and last dates with data in it

2005-07-20 Thread SGreen
ts type situation, where I want to give > people an easy option to move forward or backwards through the data once the > initial results have been displayed. > > Special note (the tricky part) Because this is an events type of situation, > not all dates will actually have d

SELECT by date plus get both next and last dates with data in it

2005-07-20 Thread me you
data once the initial results have been displayed. Special note (the tricky part) Because this is an events type of situation, not all dates will actually have data available. SAMPLE DATA: id date info --- 1 2005-01-12 big

Re: effective handling of fuzzy dates (MySQL/PHP)

2005-06-29 Thread Jochem van Dieten
On 6/29/05, me you wrote: > > For the most part, the data entered is correct and uses the full -MM-DD > format, however, I've got numerous dates that are incomplete. For example: > an event happened in 1967, but the exact month and day are not known. I've > been st

effective handling of fuzzy dates (MySQL/PHP)

2005-06-29 Thread me you
Hello, Please excuse me if this has been posted in the wrong spot. I'm storing historical information in a MySQL database and am using the date field formatted in -MM-DD. For the most part, the data entered is correct and uses the full -MM-DD format, however, I've got nume

Re: Shifting dates

2005-06-22 Thread Jochem van Dieten
On 6/21/05, Sebastian wrote: > i never understand why people use datetime anyway.. unix timestamp is so > much easier to work with. Unix epoch is by definition UTC. Sometimes I want to work with dates in some local timezone. In other databases that have a more complete implementation of t

  1   2   3   4   >