|
-
Oct 30th, 2002, 02:40 AM
#1
Thread Starter
Lively Member
coldfusion date insert problem(resolved)
how do i code some coldfusion insert data that can recieve date value:
eg:
<cfquery name="insdata" datasource="blabla">
insert into table1(name,dob)
values ('#form.namefield#','#form.dobfield#')
</cfquery>
this query give me error page....
so how do i code it? the right way?
please! please!
Last edited by ZUWARI; Oct 31st, 2002 at 03:14 AM.
-
Oct 30th, 2002, 04:06 AM
#2
Code:
<cfquery name="insdata" datasource="blabla">
insert into table1(name,dob)
values ('#form.namefield#','#DateFormat(form.dobfield,"dd mm yyyy")#
')
</cfquery>
-
Oct 30th, 2002, 04:18 AM
#3
Thread Starter
Lively Member
hmm.....
yes , no error page but the result is that when i call it back from database, the format is wrong..
eg: input in input box - 20 3 02 (dd m yy)
output using cfoutput - <cfoutput query="result">#date format(doe, "dd m yy")#</cfoutput> -----> resulted= 02 3 20 (yy m dd)
i don know what happend here....
-
Oct 30th, 2002, 04:20 AM
#4
Thread Starter
Lively Member
oppss
ignore the 'date format' .....typing error..it should be ....dateformat(doe, "d m yy")
-
Oct 30th, 2002, 05:05 AM
#5
-
Oct 30th, 2002, 11:10 PM
#6
Thread Starter
Lively Member
-
Oct 30th, 2002, 11:48 PM
#7
OK, from what I understand, you're not getting it back in the proper format.
What format are you getting it as, and what format do you want?
-
Oct 31st, 2002, 12:08 AM
#8
Thread Starter
Lively Member
i get yy mm dd format
i want ---> dd mm yy format.
even when i code the output this way....
<cfoutput query="viewdata">#dateformat(dob, "dd mm yy")#</cfoutput>
i still don get it right
-
Oct 31st, 2002, 03:11 AM
#9
Thread Starter
Lively Member
solved
thanks medhak!
i find another way around. i will only use character/string this time for the doe field. and create some javascript to validate date value.
-
Nov 2nd, 2002, 11:18 AM
#10
Well... OK.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|