Normal Topic Pestery Date String Question (Read 1003 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Pestery Date String Question
Feb 13th, 2011 at 9:26pm
Print Post Print Post  
I've had a lot of time this weekend to putter on my to do list ... hence the pestery questions.  If anyone can help me, I'm very appreciative.

OK, in this bit of code, I want to retrieve the most recent date out of a string of dates (accounts entered into my database).

I ran some scratch programming to run in a mass update window, and it's not bad.

Code
Select All
vListingArray = (@xlookupall(@FN,CltNo, "DR Screen!DBCltNo", ("DBlisted")))
// vListingArray = @Replace(vListingArray, "/", "")
vListMax = @max(vListingArray)
 



With this, I get a good string of dates:

2010/12/02;2010/12/02;2010/12/02;2010/12/23;2011/01/14;2011/01/14;2011/01/14;201
1/01/14;2011/01/14

But my @max command only gives me

2010

How can I get it to give me "2011/01/14"?

Thanks again!
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Pestery Date String Question
Reply #1 - Feb 14th, 2011 at 5:26am
Print Post Print Post  
Try something like this instead:

Code
Select All
var vStr as String
var vResult as String
var vCount as Int

vStr = @xlookupall(@FN,CltNo, "DR Screen!DBCltNo", ("DBlisted"))
vStr = @SortStringArray(vStr, 0)		// Sort the strings by ASCII
vCount = @CountStringArray(vStr)		// Count the strings
vResult = @AccessStringArray(vStr, vCount)	// Get the last string (effectively, the most recent date)

WriteLn(vResult) 

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged