Quantcast
Channel: SCN : Discussion List - SAP SQL Anywhere
Viewing all articles
Browse latest Browse all 125

Evaluate date field, use only if not null/empty in query.

$
0
0

We have this query:

 

 

select LastReqTime,

BlockedOn,

UncommitOps

FROM sa_conn_info()

WHERE LastReqTime < DATEADD(mi,-60,GETDATE()) AND BlockedON > 0 AND UncommitOps = 0

 

 

Normal data example would be 2016-05-17 17:03:42.721 in LastReqTime.

As one can see by my code, I'm checking for LastReqTime older than 60 minutes. If the field is null or empty, the code errors. I need an IF or CASE or even a nested select statement that will allow me to check the LastReqTime for notnull, I would guess !='' OR perhaps a field length greater than 0. I was hoping for a valid date/time evaluation, but apparently it's quite a bit more complicated than that Since I need results fast I figured I'd ask the experts here (of course it would be here). Thanks in advance.


Viewing all articles
Browse latest Browse all 125


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>