![]() |
|
#1
|
|||
|
|||
MySQL WHERE dd/mm/yyyyHello,
Im trying to creat a report to show all enrties in my database entered in a specific month of a specific year. However my database stores the date in a colum called date_inserted in the format dd/mm/yyyy so i havent got a clue how to SELECT * from acct_quotes WHERE date_inserted = mm/yyyy??? Any ideas would be appreciated Matt |
|||
|
#2
|
||||
|
||||
Re: MySQL WHERE dd/mm/yyyyUnless someone else has a better idea, I think you would have to use the MySQL date & time functions like YEAR() and MONTH().
Something like this: Code:
|
|
#3
|
|||
|
|||
Re: MySQL WHERE dd/mm/yyyyOnly problem with that is the date is more of a last modified date as it changes when the item is updated, Can i not just split the search by the "/"'s?
|
|
#4
|
||||
|
||||
Re: MySQL WHERE dd/mm/yyyyYou can use strtotime() (PHP function) to get the timestamp. Use e.g. date("Y") to get the month and year numbers, and work from there. This is all off the top of my head. If you show some code, maybe I can suggest something better.
|
|
#5
|
||||
|
||||
Re: MySQL WHERE dd/mm/yyyyJust for a quick check, although your date uses slashes, I tried this -- ignoring the day portion of the month:
Code:
Code:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Moving data from MySQL to MySQL | meurer | MySQL / PHP Forum | 0 | 25-Jan-2007 10:03 |
| Cpanel downgrade MYSQL 4.1.X to MySQL 4.0.xx | Webhosting-live | Web Hosting Forum | 1 | 01-Sep-2006 03:54 |
| CPanel 10, Unlimited Emails, Unlimited Subdomains, Unlimited MySQL. $2.00 per Month | Kalypsoweb | Web Hosting Advertisements & Offers | 0 | 30-Oct-2005 01:51 |
| Windows: From only £20p/y,Linux: from $10p/m. ASP, ASP.NET, PHP, Free MySQL, +More | EyotaHosts | Web Hosting Advertisements & Offers | 0 | 28-Jun-2003 14:54 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The