Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an app where I am using the "now" function to find activity for specific machines over the last 7 days. It has been working properly for two years and now for some reason it is broken. I can't figure out for the life of me why it is not working.
The function is:
count(distinct{<LastConnectionTime={">=$(=(now()-7))"},Source={'XXX'},FAU-={'redacted'}>} FAU)
This is now returning a result of 0; however, in my details table from the same data source, there are many results with LastConnectionTime in the last 7 days.
Does anyone have any ideas why this isn't working anymore?
try this
count(distinct{<LastConnectionTime={">=$(=(now()-7,'DD/MM/YYYY hh:mm:ss TT'))"},Source={'XXX'},FAU-={'redacted'}>} FAU)
Hi
count(distinct{<LastConnectionTime={">=$(=Date(now()-7,'DD/MM/YYYY hh:mm:ss TT'))"},Source={'XXX'},FAU-={'redacted'}>} FAU)
Thanks and Regards
Kashyap.R
Thanks, but this doesn't make a difference. I still get a result of 0.
Thanks, but this doesn't make a difference. I still get a result of 0.
try below
count(distinct{<LastConnectionTime={">=timestamp(now()-7,'DD/MM/YYYY hh:mm:ss TT')"},Source={'XXX'},FAU-={'redacted'}>} FAU)
Thanks, but this doesn't make a difference. I still get a result of 0.
Your timestamp-field is left-aligned and therefore very likely a string and not a real timestamp. Just load it with something like:
timestamp(
timestamp#(LastConnectionTime, 'FormatPatternSource'),
'FormatPatternTarget') as LastConnectionTime
- Marcus
Does it work correctly if you use Now(1) instead of Now()?
I had high hopes for this one, because my argument to the db guys was that the problem is that the field isn't a date field (their counter-argument was that it wasn't a date field before the server move and it worked before), but loading it with timestamp/timestamp# didn't work (I had already tried with date/date# and that didn't work either).