1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 <2019> 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 <2019> 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Count record that resets by date |
From: | Eric Norum via Tech-talk <[email protected]> |
To: | Daniel Cuneo <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Wed, 13 Mar 2019 15:12:47 -0700 |
Here’s an all-database solution that does what you want, I think. I’m no expert on databases, so there may very well be ways of doing this with fewer records. The ‘count’ record increments each time it’s processed unless the ‘clear’ record has pushed a 1 into the ‘C’ field. record(bi, "$(user):now") { field(PINI, "YES") field(SCAN, "10 second") field(FLNK, "$(user):day") } record(stringin, "$(user):day") { field(DTYP, "Soft Timestamp") field(INP, "@%j") field(TSEL, "$(user):now.TIME") field(FLNK, "$(user):clear") } record(calcout, "$(user):clear") { field(INPA, "$(user):day NPP MS") field(INPB, "1000") field(CALC, "A<B;B:=A") field(OOPT, "When Non-zero") field(OCAL, "1") field(OUT, "$(user):count.C PP") } record(calc, "$(user):count") { field(VAL, "0") field(TPRO, 1) field(CALC, "C?0:VAL+1;C:=0") }
|