Jump to content


Photo

Date Query Question.


  • Please log in to reply
1 reply to this topic

#1 gusmacker

gusmacker
  • Members
  • Pip
  • Newbie
  • 9 posts
  • LocationGrand Rapids, Michigan

Posted 14 March 2003 - 07:30 PM

I am using a php site that was created for real estate agents. I am adding a new part to the already created program to display and link open house information to each house. I have most of it done however I have one part I am had to make some changes to and now I can\'t seem to figure out what the query would be to get it to do what I want to do. Both fields are setup as date (yyyy-mm-dd) (I believe its mm-dd and not dd-mm) Anyways I have a field start_date and one end_date basicly I want to do a query and if the date is between the start and end date or is the start or end date I want it to get those results. If it is not between those dates I don\'t want it displayed.

Kevin

Thanks in advance. the PHPFreaks forums have been such a blessing.
[php:1:09d88d0ab6]<? [br]if ($SKYDIVING == "NO") { [br]$LIFE = EMPTY; [br]} else { [br]$LIFE = "FULL OF JOY"; [br]?> [br][/php:1:09d88d0ab6]

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 14 March 2003 - 09:28 PM

select * from <tablename> where <database field> >= <input from date> and <database field> <= <input to date>



Hope this helps
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users