In light of this new information my original suggestion still stands. If you format your data as a string (EX: ww:dd:hh:mm) then it will sort correctly (assuming you zero pad 3 = 03) and pure string comparison will yield correct results. ( "00:03:11:15" GT "00:03:11:25" )
-John- At 09:11 AM 12/18/2002 +0000, you wrote: >Hi, >My intention is to allow a user to select 'how long' eg, months, weeks, >days, hours, minutes, it took to solve a problem, this information will then >be stored as one field in the database. It is the intention that searches >etc can be carried out on this information for comparison. >Thanks for the help so far, >Lisa > >-----Original Message----- >From: Joe Eugene [mailto:[EMAIL PROTECTED]] >Sent: 18 December 2002 04:27 >To: CF-Talk >Subject: RE: CreateDateTime function?? > > > > Why add a date if you want to store an interval? I mean, if you want to > > calculate a new date it is the obvious route, but the request was to > > store it. > >Lisa: Can you confirm on your question? > > is, how to store the selected values into one field of my database? >Am not sure what your purpose is behind all this. >***Logically.. you would just give a drop down of dates(MM-DD-YYYY) HH:MM*** > >If i understand the question correctly.. User comes in and selects >something to happen(e.g Email me cheap flights after this period) >2 weeks >3 days >5 hours >10 minutes... > >Yes the question is how do you store weeks & days & hours and minutes... >My understanding is a future dateTime has to be created and the database >field would be a DateTime field.. in that case...? ><cfscript> >//create a default current date with form data... >myDate=CreateDateTime(year(now()),month(now),day(now()),form.hrs,form.mins,s >econd(now)); >//adding weeks here >myDate=DateAdd("ww",form.ww,myDate()); >//adding days here >myDate=DateAdd("d",form.dd,myDate()); ></cfscript> > >myDate would be the future date created from the form.. to be inserted >into the database in one DateTime FIELD. > >Joe > > > > -----Original Message----- > > From: Jochem van Dieten [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, December 17, 2002 6:58 PM > > To: CF-Talk > > Subject: Re: CreateDateTime function?? > > > > > > Joe Eugene wrote: > > > All you need is create a default date and use function > > DateAdd("",defaultDate) > > > and create whatever..date you want. Check previous post for code. > > > > Why add a date if you want to store an interval? I mean, if you want to > > calculate a new date it is the obvious route, but the request was to > > store it. Isn't creating a new date and converting that new date back to > > an interval when you need to extract the interval just a whole lot of > > extra hassle? > > > > Jochem > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.

