Re: MySQL and Dates
>>> What's the best way to convert the format my form uses to something mySQL > > > >Then use sqldate in your sql query. > >-- Josh Perfect! That's exactly what I needed. Thanks Josh! Will ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299375 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: MySQL and Dates
>> What's the best way to convert the format my form uses to something mySQL >> can read. >> I'll be looking for records between two dates, etc. Then use sqldate in your sql query. -- Josh ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299364 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: MySQL and Dates
FWIW let CF do the formatting for you, store it the way the DB handles it. On Feb 19, 2008 5:29 PM, Will Tomlinson <[EMAIL PROTECTED]> wrote: > In MySQL 5, I'm storing a date in a date field. It stores it as 2008-19-2. > > But my client wants to let users filter records using this format: > 02/19/2008 > > What's the best way to convert the format my form uses to something mySQL can > read. > I'll be looking for records between two dates, etc. > > Thanks, > Will > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299362 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
MySQL and Dates
In MySQL 5, I'm storing a date in a date field. It stores it as 2008-19-2. But my client wants to let users filter records using this format: 02/19/2008 What's the best way to convert the format my form uses to something mySQL can read. I'll be looking for records between two dates, etc. Thanks, Will ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299359 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: MySQL and Dates
I don't know about MySQL, but you are asking for trouble if you do that in Oracle since blank date fields are interpreted as a real date. You should do this: newDate = form.dueDate if NOT isdate(newDate) newDate = "NULL" UPDATE JOBINFO SET TICKETSTATUS = '#FORM.TICKETSTATUS#', DUEDATE = #newDate#, JOBNUM = #FORM.JOBNUM#, PONUMBER = '#FORM.PONUMBER#' WHERE JOBID = #FORM.JOBID# Bryan Love ACP Internet Application Developer Telecommunication Systems Inc. [EMAIL PROTECTED] -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 14, 2001 9:31 AM To: CF-Talk Subject: MySQL and Dates Im running into another strange thing im not use to with MySQL. If im doing an UPDATE on a record i have to add logic to DateTime Fields. UPDATE JOBINFO SET TICKETSTATUS = '#FORM.TICKETSTATUS#', DUEDATE = '#FORM.DUEDATE#',#FORM.DUEDATE#, JOBNUM = #FORM.JOBNUM#, PONUMBER = '#FORM.PONUMBER#' WHERE JOBID = #FORM.JOBID# If the Variable for the DateTime Field is left blank then i have to surround the Variable with single quotes. IF the variable is given a value then i cant use the single quotes. Am i doing something wrong, or is this the way it has to be with MySql DateTime fields? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
MySQL and Dates
Im running into another strange thing im not use to with MySQL. If im doing an UPDATE on a record i have to add logic to DateTime Fields. UPDATE JOBINFO SET TICKETSTATUS = '#FORM.TICKETSTATUS#', DUEDATE = '#FORM.DUEDATE#',#FORM.DUEDATE#, JOBNUM = #FORM.JOBNUM#, PONUMBER = '#FORM.PONUMBER#' WHERE JOBID = #FORM.JOBID# If the Variable for the DateTime Field is left blank then i have to surround the Variable with single quotes. IF the variable is given a value then i cant use the single quotes. Am i doing something wrong, or is this the way it has to be with MySql DateTime fields? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists