[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => mxstu [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Seperating Information from One Entry - Coldfusion - Advanced Techniques

Seperating Information from One Entry - Coldfusion - Advanced Techniques

Hey.. I'm trying to seperate numbers out from a single entry. When a user submits the form it converts their time selections to a military time and puts it in the format hh:mm:00. Seconds don't matter obviously. What I'm trying to do is on the edit page, when it loads the form where they edit, it first sets the values for the hour and minutes. Then it will select the right time in the drop downs..... no problem I can do that. My problem is gettin the hours and minutes out of hh:mm:ss. Is there a way to say run ...

  1. #1

    Default Seperating Information from One Entry

    Hey..
    I'm trying to seperate numbers out from a single entry. When a user submits
    the form it converts their time selections to a military time and puts it in
    the format hh:mm:00. Seconds don't matter obviously. What I'm trying to do is
    on the edit page, when it loads the form where they edit, it first sets the
    values for the hour and minutes. Then it will select the right time in the drop
    downs..... no problem I can do that. My problem is gettin the hours and minutes
    out of hh:mm:ss. Is there a way to say run a <cfset hours = (selecting only the
    hh from hh:mm:ss)> and a <cfset minutes = (selecting only mm from hh:mm:ss)>?
    Is that possible to do and if so how?

    weswhite7 Guest

  2. #2

    Default Re: Seperating Information from One Entry

    If your value is a valid date/time object, you could use date functions to
    extract the hours and minutes. If the value is just a string, you could use
    list functions.

    <!--- using date functions --->
    <cfset hours = datePart("h", yourValue)>
    <cfset minutes = datePart("n", yourValue)>

    <!--- using list functions --->
    <cfset hours = listFirst(yourValue, ":")>
    <cfset minutes = listGetAt(yourValue, 2, ":")>


    mxstu Guest

  3. #3

    Default Re: Seperating Information from One Entry

    well in the database its no tin there as a datetime datatype. but the format is hh:mm:ss so would it still work?
    weswhite7 Guest

  4. #4

    Default Re: Seperating Information from One Entry

    It might. You could try it. If not, you should be alble to use the list
    functions instead. Btw, if you're dealing with date/time values, you might
    consider using the correct data type to store those types of values (ie.
    date/time and not text/varchar).

    mxstu Guest

  5. #5

    Default Re: Seperating Information from One Entry

    that worked
    weswhite7 Guest

  6. #6

    Default Re: Seperating Information from One Entry

    The timeformat function will work.

    Originally posted by: weswhite7
    well in the database its no tin there as a datetime datatype. but the format is hh:mm:ss so would it still work?


    Dan Guest

Similar Threads

  1. Seperating data within a field
    By Darren in forum ASP Database
    Replies: 10
    Last Post: April 2nd, 01:17 PM
  2. seperating filenames
    By John Smith in forum ASP
    Replies: 1
    Last Post: September 16th, 01:55 PM
  3. Any ideas on how to confirm data entry of an item post entry?
    By Dale C Gray in forum Microsoft Access
    Replies: 3
    Last Post: July 21st, 03:40 AM
  4. seperating ascx and cs files
    By Salim Afar in forum ASP.NET General
    Replies: 0
    Last Post: July 10th, 01:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •