New topic: recordselect <> nil?
<http://forums.realsoftware.com/viewtopic.php?t=46662> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message ikkyino Post subject: recordselect <> nil?Posted: Wed Jan 23, 2013 9:31 pm 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 timhare Post subject: Re: recordselect <> nil?Posted: Wed Jan 23, 2013 9:40 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 12009 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 ikkyino Post subject: Re: recordselect <> nil?Posted: Wed Jan 23, 2013 9:54 pm 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 HMARROQUINC Post subject: Re: recordselect <> nil?Posted: Thu Jan 24, 2013 12:33 am Joined: Sun Jan 25, 2009 5:11 pm Posts: 337 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. _________________ Windows 8 Pro 64 bit / 8 GB RAM Windows 7 Premium / 8 GB RAM Windows 7 Home Premium 64 bit SP1 / 4 GB RAM Windows XP Pro SP3 / 2 GB RAM OSX 4 GB RAM UBUNTU 2 GB RAM Top timhare Post subject: Re: recordselect <> nil?Posted: Thu Jan 24, 2013 12:40 am Joined: Fri Jan 06, 2006 3:21 pm Posts: 12009 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? Top HMARROQUINC Post subject: Re: recordselect <> nil?Posted: Thu Jan 24, 2013 12:46 am Joined: Sun Jan 25, 2009 5:11 pm Posts: 337 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? I can post a pic of my thumbs up _________________ Windows 8 Pro 64 bit / 8 GB RAM Windows 7 Premium / 8 GB RAM Windows 7 Home Premium 64 bit SP1 / 4 GB RAM Windows XP Pro SP3 / 2 GB RAM OSX 4 GB RAM UBUNTU 2 GB RAM Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml rbforumnotifier@monkeybreadsoftware.de