Ask a Question related to Coldfusion Database Access, Design and Development.
-
cf101 #1
MySQL Dates
Hello,
I have CFM pages with Searching on Dates in MySQL. As you know MySQL Dates are
"yyyy-mm-dd" format. However, we want date entering formats in the form
(<cfform>Dates</cfform>) of "mm/dd/yyyy".
So, in this case, how can I make this searchable on dates in different format.
1. Is there a way to change Date format in MySQL? If possible to change MySQL
date types to "mm/dd/yyyy"
2. I could change date types (from the form) to "yyyy-mm-dd" format before it
is submitted to Database to search on actual dates.
How can I change date FORM format from "mm/dd/yyyy" to MySQL format
"yyyy-mm-dd"?
Point is dates in the front end userinterface must be entered "mm/dd/yyyy"
form before it goes to search dates on dates on MySQL .
Thanks:D
cf101 Guest
-
How to you compare dates in a query in Mysql
Dear friends, Plesae help in finding the correct syntax for comparing two dates in a query in MySql database Thank you Subodh Gupta -
Searching on Dates in MySQL
Hello, I have CFM pages with Searching on Dates in MySQL. As you know MySQL Dates are "yyyy-mm-dd" format. However, we want date entering formats... -
Web form dates to MySQL
I am building a admin form (PHP/MySQL), so staff can input Job Vacancy descriptions into the Website via a Web form that can be displayed on the... -
Array of Dates from MYSQL?...
This has been puzzelling me for a couple of weeks now, and just can't figure it out. Does anyone know how to return an array of dates from MySQL... -
Selecting a range of dates in MySql
I need to do a search in MySql for birth date range. (i.e. for birth date Any suggestions on how to do this select? Thanks! -
jorgepino #2
Re: MySQL Dates
#DateFormat(todayDate, "mmm-dd-yyyy")#
#DateFormat(todayDate, "mmmm d, yyyy")#
#DateFormat(todayDate, "mm/dd/yyyy")#
jorgepino Guest
-
Tulsa #3
Re: MySQL Dates
When inserting the date into your DB, use CREATEODBCDATE and it won't matter
what format the date is in.
EX.
INSERT INTO yourTable (date_field)
VALUES (#CREATEODBCDATE(form.date_variable)#)
This will adjust the date accordingly to be inserted in MySQL and will be
searchable no matter what format you use in a SELECT statement.
Tulsa Guest
-
jorgepino #4
Re: MySQL Dates
Could something like this work...
<cfset date = '01/31/2000'>
<cfoutput>
dd/mm/yyyy #date# <BR>
<cfset newdate = "#ListGetAt(date, 3 , '/')#-#ListGetAt(date, 1 ,
'/')#-#ListGetAt(date, 2 , '/')#" >
yyyy-mm-dd :
#newdate#
</cfoutput>:confused;
jorgepino Guest



Reply With Quote

