You are here: Re: Birthday SQL Problem « PHP SQL « IT news, forums, messages
Re: Birthday SQL Problem

Posted by Du on 10/02/05 16:59

I think in sql you can compare dates using >= and <= comparators
but sql standard format for date is yyyy-mm-dd
so if you want to search for that date range you need to convert your date
string

SELECT * FROM my_client WHERE DOB >= '2005-09-01' AND DOB <= '2005-10-01'

hope that helps

ps you can go here for more info on date
http://dev.mysql.com/doc/mysql/en/using-date.html



"brett" <bhalligan@yahoo.com> wrote in message
news:n43uj1d5t4lj3n4nvkk3i5vb6072rif6c9@4ax.com...
> Hi there
>
> This is my first posting here, please forgive me if I make any
> mistakes here.
>
> Ok
>
> I have the structure
>
> {CLIENTS} = Client ID, First Name, Surname, DOB, Address, Home Phone
> No, Mobile Phone No
>
> As one relation / table (There are several others in this db that are
> not related to this issue)
>
> My problem is this
>
> I need to be able to select two dates on my webby so I have a range of
> dates
>
> E.G. (using English date format DD/MM/YYYY)
>
> 01/09/2005 to 01/10/2005
>
> Then I want to be able to get, using some nifty query, everyone's
> birthday that falls between those two dates. So if someone's birthday
> was 04/09/79 it would return that tuple
>
> I have been stuck on this for ages. Any my search for help has brought
> me here.
>
> If anyone out there can help me, in any way, I would be very grateful.
>
> Kind regards
> Brett Halligan
>



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация