|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
comparing current hour with database
Another simple one.
I have 2 fields - number, that represents start_hour and end_hour in 1-24 format. I need a little help saying this where HOUR(now()) in start_hour to end_hour; using php and mysql Thanks for any idea's |
|
#2
|
|||
|
|||
|
RE: comparing current hour with database
select id,date_part('hour', mydate) from tablename where date_part('hour', mydate) >= 6 and date_part('hour', mydate) <= 22;
That's how you should do the comparing.. but I'm not quite sure how to get the currect our through the sql statements. The above code will grab all the records which is between 6-22 in mydate field. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > comparing current hour with database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|