You would use the MOD Operator. #794625 MOD 256# will return 1, #794626 MOD 256# will return 2, etc. That will give you your folder number. If the result is 0, then the folder would be 256.
On Mon, May 14, 2012 at 4:02 PM, Les Irvin <[email protected]> wrote: > > Not exactly a CF question per se, sorry... but... I'm trying to write > a formula in CF and my algebra skills are rusty. > > I'm working with a real estate MLS system that divides their online > photos, sequentially, into 256 different directories - numbered 1 > through 256. When they get up to directory 256, they start back again > at 1. When I asked for a reference table, they explained "we don't > have one, it just happens automatically". Trouble is, I need to > automatically find the photos armed only with the property number. > > For example (actual data): > property #794622 is placed in directory 254. > property #794623 is placed in directory 255. > property #794624 is placed in directory 256. > property #794625 is placed in directory 1. > property #794626 is placed in directory 2. > property #794627 is placed in directory 3. > ...and on and on sequentially... > > What formula can I use that will allow me to take any property number > (say 45 or 1023465 or 332495845745, etc, etc...) and find its > corresponding directory number? > > Thanks in advance for indulging me on this one... > Les > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351140 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

