Here's a briefer syntax:
null="#yesNoFormat(NOT Len(trim(agt_to_dtc)))#">
- Original Message -
From: "Arden Weiss"
>
>
>
>
>
>
>
>
> UPDATE MYTABLE
> SET AGT_TO_DTC =
> VALUE = null="#mTEST#" />
> WHERE ID_NUMBER = '#mFINDIT#'
>
>
[Todays Threads]
Arden,
Are you on CFMX 6.1? This should work for you if you are:
CFSQLTYPE="CF_SQL_TIMESTAMP"
VALUE="#AGT_TO_DTC#"
NULL="#Len(AGT_TO_DTC) EQ 0#" />
The above doesn't work? Odd.. Try it like I have it above... It will save
you a few lines of code... If that matters to you.
Mike
>
>
>Why not use the cfqueryparam tag -- which you should be using anyway :-)
Good Question -- used it and got success -- both blank and populated date fields now post without error -- Wh Ho !!
But had trouble getting the exact syntax you suggested to work for me -- so ended up with
Why not use the cfqueryparam tag (which you should be using anyway :-)
What you can do is take advantage of the "null" attribute in the tag.
Use an _expression_ in the null attribute like this:
null="#Len(someVariable) EQ 0#" />
Now if the _expression_ returns true, the value is ignored an
-Original Message-
From: Arden Weiss [mailto:[EMAIL PROTECTED]
Sent: Tue 4/6/2004 9:44 PM
To: CF-Talk
Cc:
Subject: How to post a null date variable to a table
How to post a null date to SQL Server 2000 via a variable instead of just using the word "Null" or do I have to use an embedded C
Yes the existing code works, but what if the variable #appl_date# becomes blank on the user's input form/field -- then a 1/1/1900 date gets posted to the APPL_DATE field in MYTABLE table.
APPL_DATE = #APPL_DATE# ,
The alternative is to use a CASE statement in the UPDATE query, but I can't seem t
just like that, to my knowledge? if you do that, does it put 01/01/1900?
or does it put null?
tony
r e v o l u t i o n w e b d e s i g n
[EMAIL PROTECTED]
www.revolutionwebdesign.com
its only looks good to those who can see bad as well
-anonymous
-Original Message-
From: Arden Weis
7 matches
Mail list logo