Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Nov 15, 2018 12:01 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: recordselect <> nil?
PostPosted: Wed Jan 23, 2013 9:31 pm 
Offline
User avatar

Joined: Sun Nov 02, 2008 7:39 pm
Posts: 36
if rs.Field("warndate") <> nil then
//code

How come this doesn't work? It'll compile but it will disregard if it's nil or not.
I know how to do it with an sqlselect but that's not exactly what I want to accomplish. I have an idea of how to hack around it by setting it to a value that wouldn't be used... I'd rather not do that though.

_________________
-Ikkyino


Top
 Profile  
Reply with quote  
 Post subject: Re: recordselect <> nil?
PostPosted: Wed Jan 23, 2013 9:40 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Are you trying to test for a column whose value is Null? That is different than Nil. Try something like

if rs.Field("warndate").Value.IsNull then


Top
 Profile  
Reply with quote  
 Post subject: Re: recordselect <> nil?
PostPosted: Wed Jan 23, 2013 9:54 pm 
Offline
User avatar

Joined: Sun Nov 02, 2008 7:39 pm
Posts: 36
if not rs.Field("warndate").Value.IsNull then

That did the trick. I tried that earlier and it didn't work but that was my mistake with setting up the database and I never thought to go back and try it again. Thank you timhare. Over the years you have been the greatest help!

_________________
-Ikkyino


Top
 Profile  
Reply with quote  
 Post subject: Re: recordselect <> nil?
PostPosted: Thu Jan 24, 2013 12:33 am 
Offline
User avatar

Joined: Sun Jan 25, 2009 5:11 pm
Posts: 576
Location: Guatemala, Central America
ikkyino wrote:
if not rs.Field("warndate").Value.IsNull then

That did the trick. I tried that earlier and it didn't work but that was my mistake with setting up the database and I never thought to go back and try it again. Thank you timhare. Over the years you have been the greatest help!


Tim is like the live help desk for RS. we should buy him beer.

_________________
Future RS guru.
Ride the world!


Top
 Profile  
Reply with quote  
 Post subject: Re: recordselect <> nil?
PostPosted: Thu Jan 24, 2013 12:40 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
HMARROQUINC wrote:
Tim is like the live help desk for RS. we should buy him beer.

Where's the LIKE button on this thing? :D


Top
 Profile  
Reply with quote  
 Post subject: Re: recordselect <> nil?
PostPosted: Thu Jan 24, 2013 12:46 am 
Offline
User avatar

Joined: Sun Jan 25, 2009 5:11 pm
Posts: 576
Location: Guatemala, Central America
timhare wrote:
HMARROQUINC wrote:
Tim is like the live help desk for RS. we should buy him beer.

Where's the LIKE button on this thing? :D


I can post a pic of my thumbs up

_________________
Future RS guru.
Ride the world!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group