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

Posted by brett on 10/02/05 19:37

On Sun, 2 Oct 2005 09:59:48 -0400, "Du" <vietquest@hotmail.com> wrote:

>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 =----


Thanks for the reply :)

I appreciate you helping me out!

I have tried something similar to that, I find it only tells me if
they are born within the date specified.

What I would like to do is when the users picks a range of dates, see
if the day of the month and the month of the year of clients DOB in
the clients table, are within the date range the user selected, so I
know if the clients birthday is coming up within that range

so I want to find everyone birthday next week, I select the range for
next week and then query the db to see if people where born this time
of year X amount of years ago. if you get what I mean

So I can say "is it johns birthday this week" select the range, of
dates in the future, and view the results, if no results, then it
isn't his bday, if results then it is his bday.

Thank for helping me :)

Brett

 

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

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