• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

date "1900-01-01 00:00:00.000"

hi,

When the date textbox is empty.  It will insert into my table DateResolved like this
"1900-01-01 00:00:00.000"

I don't want to insert anthing if there is no date.

here's my code

     

    <cfif IsDefined('FORM.DateResolvedtxt') && #form.DateIdentifiedtxt# neq ''>
           <cfqueryparam value="#form.DateResolvedtxt#" cfsqltype="cf_sql_timestamp"> ,
            <cfelse>
			NULL , 
			</cfif>  

Open in new window

0
lulu50
Asked:
lulu50
  • 2
1 Solution
 
gdemariaCommented:
I think && is the wrong operator and I would test for IsDate()

<cfif IsDefined('FORM.DateResolvedtxt') and isDate(form.DateIdentifiedtxt)>
      <cfqueryparam value="#form.DateResolvedtxt#" cfsqltype="cf_sql_timestamp"> ,
<cfelse>
      NULL ,
</cfif>
0
 
lulu50Author Commented:
gdemaria,

wow, I don't know what to say.

I have tried everything but it didn't work, nothing works with me.

Great!!

Thank you it works great now!!!

hmmm, maybe I should change my profession.

lol
Thanks again,
Lulu
0
 
lulu50Author Commented:
Excellent!!!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now