MySQL

Moderators: Jonathan
Number of threads: 266
Number of posts: 525

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: Select record based on 'change' date Posted by Jonathan on 28 Mar 2004 at 6:31 AM
: I currently have a database containing a table with the following fields:
: signid, sign_typ, changedate and time.
:
: The 'changedate' field is the date on which the star sign changes and becomes 'active' until the next 'changedate' in the table. I am trying to search this field by a date the user enters and display the 'sign_typ'.
:
:
: I am struggling to get this working and any help would be greatly appreciated.
:
You'd probably find this a lot easier if you added a third filed, enddate, which is the date when this sign ends. Then you can write a query with a WHERE clause like:-

WHERE changedate >= '$theDateYouHave' AND endDate <= '$theDateYouHave'

Make sure changedate and enddate have a column type of DATE. You need to feed the date in in the format YYYY-MM-DD if I remember correctly.

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Thread Tree
jacko201 Select record based on 'change' date on 22 Mar 2004 at 6:45 AM
Jonathan Re: Select record based on 'change' date on 28 Mar 2004 at 6:31 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.