Jump to content

mysql time format


project3

Recommended Posts

I have a db table that has field with the TIME for the field type. I do some between statements with the sql statements to pull results.

 

like $time_now between open and close;

 

what happens is there are different time periods allowing each place to have 3 sets of open times each day.

 

like

open  close

10:00  12:00

14:00  18:00

19:00  21:00

 

well everything works fine for finding the open places but I want to show places that are closed

and have them shadowed.

 

so what i did was a not between.

 

but say a place only has one set of open times.

because the time field puts 00:00:00 during the periods that are not filled in.

 

the not between wont work because not between 00:00 and 00:00 makes the result

show up on all of them.

 

so I was wondering how I can get this to work. I thought about changing the field to varchar

but im not sure that I could still do the time  comparisons if its not time. and if the ones not

filled in were blank and not 00:00 I think it would still come up in not between.

 

Any help here would be greatly appreciated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.