Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread itoctopus
I remember I had the same problem for the between dates. for example, Select * FROM the_table WHERE the_date BETWEEN '2007-01-01' AND '2007-01-31', the problem that it wasn't including the 2007-01-31, I discovered later on that it should be something like: SELECT * FROM the_table WHERE the_date B

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Tony Grimes
Nice! That did the trick. Thanks Brad. I live to fight another day. Tony On 5/18/07 3:00 PM, "Brad Bonkoski" <[EMAIL PROTECTED]> wrote: > Try using the substr, since you are only comparing the first letters... > (sorry I did not reply all on the other email, Dan) > > i.e. > > select name from

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Tony Grimes
Yeah, but what do I do for Q-Z? I guess I¹ll have to write a condition to use last_name >= ŒQ¹ if it finds a Z. I¹ll have to write conditions to look for other exceptions too. Aaarrgh! *looks up at the Gods* Damn you BETWEEN! Why must you torture me so!?! Have a good weekend. On 5/18/07 2:51

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Brad Bonkoski
Try using the substr, since you are only comparing the first letters... (sorry I did not reply all on the other email, Dan) i.e. select name from users where substr(name, 1, 1) >= 'A' and substr(name, 1, 1) <= 'B'; -B Dan Shirah wrote: So just change it to WHERE last_name BETWEEN 'A' AND 'G'

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Dan Shirah
So just change it to WHERE last_name BETWEEN 'A' AND 'G' . That'll get you Aa-Fz :) On 5/18/07, Tony Grimes <[EMAIL PROTECTED]> wrote: We tried that and it didn't work. We've also tried every combination of upper and lower case too. Tony On 5/18/07 2:18 PM, "Brad Bonkoski" <[EMAIL PROTECTE

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Tony Grimes
We tried that and it didn't work. We've also tried every combination of upper and lower case too. Tony On 5/18/07 2:18 PM, "Brad Bonkoski" <[EMAIL PROTECTED]> wrote: > I think you need between 'A' and 'F%' > > Aa is between A and F > but 'Fa' is not between 'A' and 'F' > (but 'Ez' would be bet

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Brad Bonkoski
I think you need between 'A' and 'F%' Aa is between A and F but 'Fa' is not between 'A' and 'F' (but 'Ez' would be between 'A' and 'F') -B Tony Grimes wrote: I'm using BETWEEN to return a list all people who's last names fall between A and F: WHERE last_name BETWEEN 'A' AND 'F' ... but

[PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Tony Grimes
I'm using BETWEEN to return a list all people who's last names fall between A and F: WHERE last_name BETWEEN 'A' AND 'F' ... but it's only returning names between A and E. The same thing happens when I use: WHERE last_name >= 'A' AND last_name <= 'F' ... Shouldn't this work the way I

RE: [PHP-DB] Re: MySQL 0 index date and time functions (mode or typo)?

2007-05-18 Thread Dwight Altman
Yes, that table is self-explanatory for WEEK. I was asking about DAYOFMONTH and MONTH returning 0, since there does indeed exist an explanation for WEEK returning a 0. Regards, Dwight > -Original Message- > From: itoctopus [mailto:[EMAIL PROTECTED] > Sent: Friday, May 18, 2007 6:58 AM > T

[PHP-DB] Re: MySQL 0 index date and time functions (mode or typo)?

2007-05-18 Thread itoctopus
Hey, I think this table is self-explanatory: First day Mode of week Range Week 1 is the first week . 0 Sunday 0-53 with a Sunday in this year 1 Monday 0-53 with more than 3 days this year 2 Sunday 1-53 with a Sunday in this year 3 Monday 1-53 with more than 3 da