|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
I am receiving the following error message
Quote:
I am sure it is something stupid that I can't see in my query statement but I'm not sure what. Here is the actual Query Quote:
__________________
CHornJr "One day I'll know what I am doing" ![]() My Blog Suanhacky Lodge #49 Rebel Squadrons |
|
#2
|
||||
|
||||
|
what version of mysql are you using? UTC_DATE() is valid for v4.1.1 or later. that may be the problem. if not, then im stumped :P
__________________
|
|
#3
|
||||
|
||||
|
now that i look, are you using UTC_DATE() correctly? i know it returns the current date, but i didnt know you could pass it arguments.
|
|
#4
|
||||
|
||||
|
I am using version 5.0
Maybe it can't pass arguments, but the MySQL manual didn't say it couldn't. The truth is this was just a test because I really am going to need it in my where clause where I have a date column and I want I it be be true only if it is the current date or earlier. So if UTC_DATE isn't going to work how would be a good way to compare that be. Currently I have PHP Code:
|
|
#5
|
||||
|
||||
|
well, if you can figure out the syntax to format the date so its a number YYYYMMDD without the dashes in it, then it should work, as long as you store the date the same.
|
|
#6
|
||||
|
||||
|
Date is currently stored as YYYY-MM-DD in the database (its a Date Column) and unfortunetly changing it to another column type isn't going to be possible at the moment.
I was hoping to be able to use UTC to convert it to YYYYMMDD Last edited by CHornJr : July 3rd, 2007 at 12:44 PM. Reason: Left something out |
|
#7
|
||||
|
||||
|
use the explode() function. here's the link to the syntax:
http://us3.php.net/manual/en/function.explode.php you can grab the date, explode it, then compare as an int. |
|
#8
|
||||
|
||||
|
I'm a little confused on how you want me o use the exploda function because the date column in the database is still going to output its conents as YYYY-MM-DD in the whre clause
|
|
#9
|
||||
|
||||
|
I go it working, I am an idiot. I should have been using CURDATE Function all along. SO It now appears to be working correctly. THanks for your help
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > UTC_DATE() query Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|