|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
SELECTing between dates and times
Hi, I'm attempting to write a PHP proggie that pulls data from a MySQL database based on user input and I'm have trouble getting it to SELECT based on a given set of times and dates. I was curious as to whether or not anyone knows of a function in MySQL which allows this to happen as the standard "where ih_date > '2003-03-01'" gives errors. I'm assuming this is because I'm using the date type for the field and it needs a special function to to compare dates and times. I'm also having a similar problem parsing times. I'm fairly new to MySQL and I've tried reading through the manual, but it's not exactly the most intuitively laid out thing in the world. Especially when you're not sure exactly what you're looking for. Anything anyone could say that would help would be great, thanks.
|
|
#2
|
|||
|
|||
|
RE: SELECTing between dates and times
That comparison should work. I use statements like that all the time. Can you provide the entire SQL statement that is failing, along with the error message?
|
|
#3
|
|||
|
|||
|
RE: SELECTing between dates and times
Yeah, so call me stupid, it was an error with the position of the ORDER and WHERE statements. I wasn't aware that there was an order of operations, guess I found that one out. Anyways, thanks for the help. I'm in the middle of writing a site log / log viewer and was in the middle of write the data retrieval routines based on user inputs. The query line is actualy quite long, so it was an easy fix, just not easy to find since I failed to test it in stages as I added things.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > SELECTing between dates and times |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|