Parker Software Ltd Homepage
Forum Home Forum Home > Email2DB Email Parser > General
  New Posts New Posts RSS Feed: Conditional Send with Null Field
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Conditional Send with Null Field

 Post Reply Post Reply
Author
Message
CoQ10 View Drop Down
New User
New User


Joined: 14 Jul 2008
Location: Minneapolis
Posts: 32
Post Options Post Options   Quote CoQ10 Quote  Post ReplyReply Direct Link To This Post Topic: Conditional Send with Null Field
    Posted: 11 Mar 2010 at 11:13pm
Hi,

I am trying to trigger a conditional Email send based on a database field. If the field (string) has a non NULL value I would like to send the Email. I am having trouble testing for the NULL condition.
I tried testing for 0, String length and IsNull   , nothing is working so far. During the database lookup I set the val to 0 if nothing exists.

FieldStr = FIELDS_Value("EmailContact4")
 AddressLen = Len(FieldStr) ' Len fails also
 Result = IsNull( FieldStr)


    If Result  Then
        Email2DBSend = False
    Else
        Email2DBSend = True
    End If

Thanks
Paul

Back to Top
CoQ10 View Drop Down
New User
New User


Joined: 14 Jul 2008
Location: Minneapolis
Posts: 32
Post Options Post Options   Quote CoQ10 Quote  Post ReplyReply Direct Link To This Post Posted: 12 Mar 2010 at 5:20pm
I solved the problem, it helps if you type the variable name correctly.

 I ended up using AddressLen = Len(FieldStr). Hopefully this will be a reliable way of detecting NULL database fields?
Back to Top
Stephen View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 Oct 2005
Location: Stoke on Trent
Posts: 1131
Post Options Post Options   Quote Stephen Quote  Post ReplyReply Direct Link To This Post Posted: 13 Mar 2010 at 9:02am
Email2DB will always return a blank string or a zero value if the field is null.
 
So a test for Len(Field) = 0 is the best option.
 
Steve
Back to Top
CoQ10 View Drop Down
New User
New User


Joined: 14 Jul 2008
Location: Minneapolis
Posts: 32
Post Options Post Options   Quote CoQ10 Quote  Post ReplyReply Direct Link To This Post Posted: 17 Mar 2010 at 2:43pm
I am getting the error  *Error lookup field:Invalid use of Null
 *SQL Was: SELECT * FROM ContactTable WHERE ModelSerial = 'M87_1256'. I modified the Lookup field to place a 0 if no value is returned but this did not eliminate the error. How do I eliminate this error for a blank database field?

Paul

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.203 seconds.
These are the forums for Parker Software, developers of Live Chat Software: WhosOn and Email Automation Software: Email2DB.