Title: Message
george,
 
whenever i am inserting dates passed from a form i do this in the insert:
 
#CreateODBCDate(lsparsedatetime(form.news_finish_date))#
 
of course for this to work i have also set my locale in the application.cfm:
 
<cfsilent><cfoutput>#Setlocale("English (Australian)")#</cfoutput></cfsilent>
 
try that and see how you go, but i have never had an issue since adding the lsparsedatetime function.
 
steve
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of George Lu
Sent: Monday, 31 May 2004 11:05 AM
To: CFAussie Mailing List
Subject: [cfaussie] SQL Server date format (please help!)

Hi,
 
I've been driving crazy with this date issue. We've upgraded our Access dbs to SQL Server recently. We have form input using Aussie date format: dd/mm/yyyy and is same in the database (I've set the default language to 0 - international in SQL Server). However when I use LSDateFormat to display the date it always change to American format: mm/dd/yyyy (e.g. 7/6/2004 becomes 6/7/2004). I've tried some options:
 
<cfset SQLDate = DateFormat(Form.CloseDate, "yyyy/mm/dd")>
 
OR
 
<cfscript>
 theDate = Attributes.formfield;
 firstSeparator = find("/",theDate,0);
 theDay = left(theDate,firstSeparator-1);
 theYear = right(theDate,4);
 remaining = Right(thedate,len(thedate)-firstseparator);
 theMonth = left(remaining,find("/",remaining)-1);
 Caller.SQLDate = createdate(theYear,theMonth,theDay);
</cfscript>
<cfset newSQLDate = DateFormat(variable.SQLDate, "dd/mm/yyyy")>
 
However, none of them work! Please help!
 
Thanks in advanced.
George
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

AMES (Adult Multicultural Education Services)
www.ames.net.au


Disclaimer
**********************************************************************
This email and any attachments may be confidential.
If received in error, please contact us and delete all copies.
Before opening or using attachments you should check them for viruses
or defects.
Regardless of any loss, damage or consequence, whether caused by the
negligence of the sender or not, resulting directly or indirectly from
the use of any attached files our liability is limited to resupplying
any affected attachments.
Any representations or opinions expressed are those of the individual
sender, and not necessarily those of Adult Multicultural Education
Services (AMES).

**********************************************************************
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to