Forum Moderators: coopster

Message Too Old, No Replies

i need help with dates

date format and using where

         

nofia

2:02 pm on Jun 10, 2008 (gmt 0)

10+ Year Member



i have a tabel with a date column etapedate formated y-m-d, 0000-00-00

i have a calender on a page that shows the current year and month and has the ability to go a month forward or backward depending on which button is pressed

i want to have my calender at the top of the page and the current months events listed in a table below it, depending on the year and month shown on the calender, ex Jun 2008

i need some type of query with a where clause saying somethting like

where etapedate == $etapeym equals year and month of calender

in my where clause how do i do a where for just the year and month and not the day

thanks
jd

d40sithui

3:30 pm on Jun 10, 2008 (gmt 0)

10+ Year Member



Have you tried using substrings?


//selects june 2008
$sql = "SELECT etapedate FROM myTable WHERE SUBSTRING(etapedate,1,4)='2008' AND SUBSTRING(etapedate,6,2)='06'";

nofia

3:49 pm on Jun 10, 2008 (gmt 0)

10+ Year Member



thanks d40sithui
it worked

this site rocks

jd