Forums
This topic is locked
Conditional region with null value
Posted 21 Jun 2004 00:49:50
1
has voted
21 Jun 2004 00:49:50 Simon Gosling posted:
I'm trying to display two conditional regions to identify if an activity is "late" or "on schedule". I have two date fields for comparison - 'planned' and 'actual'. I've used the following code:<% if rs_Projects.Fields.Item("Planned".Value >= rs_Projects.Fields.Item("Actual".Value then %>
On schedule
<% else %>
Late
<% end if %>
However, there could be a null value in both fields and if that's true I don't want to display anything.
Any help would be appreciated as my brain appears to have stopped and I have a deadline looming.
Thanks.
Edited by - Simon Gosling on 21 Jun 2004 10:37:19
Replies
Replied 21 Jun 2004 12:29:04
21 Jun 2004 12:29:04 Simon Martin replied:
You could wrap that lot up in another
<% if rs_Projects.Fields.Item("Planned".Value and rs_Projects.Fields.Item("Actual".Value is not null then%>
do your code
<% else %>
do nothing
<% end if %>
HTH
Simon
Edited by - ganseki on 21 Jun 2004 12:30:18
<% if rs_Projects.Fields.Item("Planned".Value and rs_Projects.Fields.Item("Actual".Value is not null then%>
do your code
<% else %>
do nothing
<% end if %>
HTH
Simon
Edited by - ganseki on 21 Jun 2004 12:30:18
Replied 22 Jun 2004 00:26:30
22 Jun 2004 00:26:30 Simon Gosling replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Thanks for the help Ganseki.
I swapped
is not null
for
<> ""
and your suggestion works fine.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Edited by - Simon Gosling on 22 Jun 2004 00:29:22
Edited by - Simon Gosling on 22 Jun 2004 00:29:49
Thanks for the help Ganseki.
I swapped
is not null
for
<> ""
and your suggestion works fine.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Edited by - Simon Gosling on 22 Jun 2004 00:29:22
Edited by - Simon Gosling on 22 Jun 2004 00:29:49
Replied 22 Jun 2004 16:06:36
22 Jun 2004 16:06:36 Simon Martin replied:
yeah sorry about that - my head was wedged in the rear end of a sql database