Scripting

  • 1.  Does anyone have a script to identify the last rec

    Posted 10-23-2014 08:48
    Does anyone have a script to identify the last record of a table? I am trying to have a script identify the last record of a user-defined table and grab values from that table. My searches have been fruitless so any help would be appreciated!


  • 2.  RE: Does anyone have a script to identify the last rec

    Posted 10-23-2014 10:49
    Could you include a date/time stamp in the UDT, and they query from that?


  • 3.  RE: Does anyone have a script to identify the last rec

    Posted 10-23-2014 11:02
    Interesting! Do you know the syntax to say ""find newest time""?


  • 4.  RE: Does anyone have a script to identify the last rec

    Posted 10-23-2014 12:02
    You may want to store the date/time as the number of seconds since an arbitrary date and then just look for the largest value as you parse through the UDT. In VBScript, it would be something like datediff(""s"", ""1/1/2000 12:00:00 AM"", now()) to generate the number.


  • 5.  RE: Does anyone have a script to identify the last rec

    Posted 10-23-2014 12:25
    I like @SteveIwanowski's idea. I don't get a chance to SQL much, and I'm just doing this off my head, but syntax for such a query would be something like: SELECT TOP 1 Column1, Column2 FROM UDT ORDER BY SecondsFromAribitraryDate DESC;


  • 6.  RE: Does anyone have a script to identify the last rec

    Posted 10-23-2014 12:31
    Can't you just do something like : Assuming your UDT is referenced as oUDT retVal = oUDT.MoveLast() Then do your GetValue's


  • 7.  RE: Does anyone have a script to identify the last rec

    Posted 10-23-2014 13:43
    Thanks for your input everyone! I will put these to the test and follow back up.