Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find if a Date is Null 1

Status
Not open for further replies.

CasperTFG

Programmer
Nov 15, 2001
1,210
US
How would I find if a Database returns NULL or Nothing on a date field.

{T_StatusLogs.SetDT} <= {?Pm-@EndDT} and
({T_StatusLogs.ClearDT} >= {?Pm-@StartDT} or
{T_StatusLogs.ClearDT} = 0)

= 0 does not work, Null does not work? any thoughts on if I can find out it the ClearDT is Nothing.


Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
Try:

{T_StatusLogs.SetDT} <= {?Pm-@EndDT} and
({T_StatusLogs.ClearDT} >= {?Pm-@StartDT} or
IsNull({T_StatusLogs.ClearDT}))

-dave
 
That still did not do it?

Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
Put the IsNull first

Code:
( 
   IsNull( {T_StatusLogs.ClearDT} )
   OR {T_StatusLogs.ClearDT} >= {?Pm-@StartDT} 
)

AND

{T_StatusLogs.SetDT} <= {?Pm-@EndDT}



Bob Suruncle
 
Got it... the Brackets were out of order...

{T_StatusLogs.SetDT} <= {?Pm-@EndDT} and
(IsNull({T_StatusLogs.ClearDT}) or
{T_StatusLogs.ClearDT} >= {?Pm-@StartDT}) and
{T_StatusLogs.ClassUID} = 2

Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
Note that all Crystal tests stop when they encounter a Null, and you must always test for them first.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top