Re: Sort on time

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 53354
interpreted = N
texte = Thanks for the help. I was able to convert the data to the HH:MM:SS format. However, client doesn't want military time displayed to the End User. How can I convert what is displayed to 12 hour. I will look into the suggestion previously mentioned using the [convertwords] command. Is there any other way? Vince -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Kenneth Grome Sent: Sunday, October 12, 2003 8:56 PM To: WebDNA Talk Subject: Re: Sort on time >I am running WC 4.xxxx and I'm stuck on something that is probably very >simple. I need to sort on time. I am not sure if WC can sort 12 hour >time value. > >Example: > >start_timetype=time&start_timesort=1 > >Where [start_time]=1:00PM > >I can sort using 24 Hour time and if this is my only option, how can I >make the field display in 12 hour format. Your times should be stored in the db in HH:MM:SS format. If they are, sorting by time is a no-brainer because these values will always sort properly without using the "type=time" parameter, since they are already in a format that naturally sorts alphabetically in ascending or descending order without it. But if your times are not stored in the proper format, you can do one of two things, depending upon your situation: 1- If you can change the format in the without creating any other problems or hassles, just write a webdna admin template that changes all your 12-hour am and pm values into the HH:MM:SS format. Then run this template ONCE, and from then on always store new times in the proper HH:MM:SS format. 2- If you cannot change this format easily because of your situation (such as if you're getting these values from someone else's db's and you have to use the other db's to update your data all the time), then you should write an admin template that adds another field to the db, then converts the 12-hour time values into HH:MM:SS format and stores then in the NEW field. Then you will have to run this template every time you replace your old db with a new one fro the other source. This leaves your original field data untouched, and yet you can now sort properly by time because of the values in the new field. -- Sincerely, Kenneth Grome ------------------------------------------------------------- Outsource your WebDNA programming for $18 an hour or less! ------------------------------------------------------------- ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Sort on time ( "Vincent Medina" 2003)
  2. Re: Sort on time ( 2003)
  3. Re: Sort on time ( Kenneth Grome 2003)
  4. Re: Sort on time ( "Vincent Medina" 2003)
  5. Re: Sort on time ( Kenneth Grome 2003)
  6. Re: Sort on time ( Tim Robinson 2003)
  7. Re: Sort on time ( "Vincent Medina" 2003)
  8. Re: Sort on time ( Tim Robinson 2003)
  9. Re: Sort on time ( Gary Krockover 2003)
  10. Sort on time ( "Vincent Medina" 2003)
Thanks for the help. I was able to convert the data to the HH:MM:SS format. However, client doesn't want military time displayed to the End User. How can I convert what is displayed to 12 hour. I will look into the suggestion previously mentioned using the [convertwords] command. Is there any other way? Vince -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Kenneth Grome Sent: Sunday, October 12, 2003 8:56 PM To: WebDNA Talk Subject: Re: Sort on time >I am running WC 4.xxxx and I'm stuck on something that is probably very >simple. I need to sort on time. I am not sure if WC can sort 12 hour >time value. > >Example: > >start_timetype=time&start_timesort=1 > >Where [start_time]=1:00PM > >I can sort using 24 Hour time and if this is my only option, how can I >make the field display in 12 hour format. Your times should be stored in the db in HH:MM:SS format. If they are, sorting by time is a no-brainer because these values will always sort properly without using the "type=time" parameter, since they are already in a format that naturally sorts alphabetically in ascending or descending order without it. But if your times are not stored in the proper format, you can do one of two things, depending upon your situation: 1- If you can change the format in the without creating any other problems or hassles, just write a webdna admin template that changes all your 12-hour am and pm values into the HH:MM:SS format. Then run this template ONCE, and from then on always store new times in the proper HH:MM:SS format. 2- If you cannot change this format easily because of your situation (such as if you're getting these values from someone else's db's and you have to use the other db's to update your data all the time), then you should write an admin template that adds another field to the db, then converts the 12-hour time values into HH:MM:SS format and stores then in the NEW field. Then you will have to run this template every time you replace your old db with a new one fro the other source. This leaves your original field data untouched, and yet you can now sort properly by time because of the values in the new field. -- Sincerely, Kenneth Grome ------------------------------------------------------------- Outsource your WebDNA programming for $18 an hour or less! ------------------------------------------------------------- ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ "Vincent Medina"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

relogin same user? (1998) Text data with spaces in them... (1997) f2 download problems (1997) international time (1997) quitting (1997) [include] error message (was:how to put/keep product customization info in basket?) (1998) Search minus first found (1999) WebCatalog2 Feature Feedback (1996) Price problem (1997) Date Formats (1997) E-mailer error codes (1997) [WebDNA] Snow Leopard (2009) Trigger Problem ---- SOLVED (2003) Lots of bounce errors (2007) WCS Newbie question (1997) WebCat on Linux (2000) Help w/Multi User Admins (1997) Mozilla/4. and Browser Info.txt (1997) Setting up the server (1997) OK, here goes... (1997)