Special Date Edit

Bruce Easton bruce at stn.com
Tue Oct 6 13:06:46 PDT 2015


Stanley, when do need sorting in such a way to be available?  If it's 
just for reporting via output request, you should be able to  use a 
sort-selection prc table (called with -v) to override the sort:

i.e, "Then: 
sort1(10,*,a)=mid(4,"7","4")&"/"&mid(4,"1","2")&"/"&mid(4,"4","2")
       "Then:  select

(assuming here that field 4 contains the date field in question)
(this example also assumes that you date field data is at least 
consistently "##/##/####" - that you don't have things like "2/2/2007" 
where there is no zero-padding for the portions of the date field)
[and if your date fields have varying separators other than "/", you 
could still use the technique above I think using an override sort field 
as (8,*,a) and then just leave the separators out: 
mid(4,"7","4")&mid(4,"1","2")&mid(4,"4","2")  ]

Bruce

On 10/6/15 3:05 PM, Stanley - stanlyn.com via Filepro-list wrote:
>>> How do you expect date math to work?
> For sorting, have the missing portion take on a 00 or 0000 if a year.
>
> In other words day and month "00" would be the day or month before "01", and year "0000" would be the year before "0001"
>
> I fully understand that 00/15/2015 is an invalid date, however I'm looking for a way that allows entry into a date field and sort before a date of 01/15/2015 and 01/01/2015, whereas a date of 00/00/2015 would sort before 01/01/2015.
>
> Another way of looking at it would be to sort it as a string in year/month/day order.  Then sorting of these invalid values would be correct.
>
> Any way to get an edit to do this instead of treating it as a string?
>
> It should be noted that I do not like the idea of having invalid dates in the database, but we have a lot of invoices that needs entered where we don't have valid complete date info, instead we have fragments and those fragments which we know to be true needs to be entered into the proper placeholder, ie. month, day or year part.  Then see those items in a report along with invoices having good dates and selected as part of a date range.  As a string, 2015/01/00 sorts after 2014/12/31 and before 2015/01/10.
>
> So maybe that is the answer, create an edit in year/month/day order.  Do you see any issues with sorting, selecting a range, etc.?
>
> Thanks,
> Stanley
>
>
>
>
> -----Original Message-----
> From: Kenneth Brody [mailto:kenbrody at spamcop.net]
> Sent: Tuesday, October 6, 2015 1:24 PM
> To: Stanley - stanlyn.com <stanley at stanlyn.com>; filepro-list at lists.celestial.com
> Subject: Re: Special Date Edit
>
> On 10/6/2015 1:11 PM, Stanley - stanlyn.com via Filepro-list wrote:
>> Hi,
>>
>>
>>
>> I need a special edit that allows the entry of bad dates AND allows
>> for date math.  For example we have a lot of invoices that portions of
>> the date is unknown like having a missing day part or a missing month
>> part, or a missing year part.
>>
>>
>>
>> ??/02/2000
>>
>> 12/??/2000
>>
>> 12/15/????
>>
>> And any other combination,
> How do you expect date math to work?
>
> What's the day after "12/??/2000"?
>
> How many days are there between "??/02/2000" and "12/??/2000"?
>
> --
> Kenneth Brody
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>




More information about the Filepro-list mailing list