EasyCFM.COM ColdFusion Forums / Coding Help! / Drop Down for Select Times

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Drop Down for Select Times

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

4Dante
11-18-2008 @ 9:41 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 7
Joined: Feb 2008

Hi,

I'm kinda a noob and though I know a few ways to do this, I wondered what is the most practical way to approach this issue.

I'm creating a scheduling page that will allow users to pick a start time and end time for each day of the week.  

I wasn't sure what format was best to use in the DB since it's just the time so 'datetime' didn't seem appropriate but maybe I'm wrong there.

I was also gonna use 2 drop-down boxes for each day of the week (one as a start time and the other as an end time) though again, I wasn't sure if this was the most efficient way to do this. Should I use a loop, or reference a table for the available times, or just manually list each option in the select statement.

I appreciate any help and advice you can give.

Thanks!

4Dante
11-18-2008 @ 12:44 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 7
Joined: Feb 2008

Ok, how about this:

What data-type would you recommend I use in the DB to track time (i.e. 8:00 PM)  DateTime? Int? VarChar?  

Thanks


cfSearchin
11-18-2008 @ 2:06 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

quote:

What data-type would you recommend I use in the DB to track time (i.e. 8:00 PM)  DateTime? Int? VarChar?


It depends on your database type. But assuming yours does not have a "time" data type, datetime is usually the best choice for both date and time values.


4Dante
11-18-2008 @ 2:49 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 7
Joined: Feb 2008

yeah, I don't have "time" as an option, but would DateTime be ok if I'm just using time and not a date?

cfSearchin
11-18-2008 @ 2:55 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

Yes, absolutely.

4Dante
11-18-2008 @ 4:26 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 7
Joined: Feb 2008

Thanks!


Website Designed and Developed by Pablo Varando.