Special Date Edit

Richard D. Williams richard at appgrp.net
Wed Oct 7 06:01:26 PDT 2015


Stanley,

You will agree this is a strange problem.

But I think there is a solution.

Your issue is two fold, data input and then reporting.

Let me suggest this for your data input control.

Have to fields for the data, one is a regular date edit (10, mdyy/)and 
the other simply require nn/nn/nnnn. (n could be a number or n could be a ?)
Put a dummy field on the screen with the nn/nn/nnnn edit
When the cursor leaves this field you must first look for any ?, this 
would tell you NOT to fill in the real date field and put this data into 
the other real field.
If there are no ? in the field, test it by using another dummy var while 
a real date edit and attempt some date math, i.e. ha(8,mdy/)=hb+"0", (hb 
is the dummy var on the screen)
If you get 01/01/83 or no date at all you know there is an issue.
Then I would locate the issue by testing the value in the hb(nn/nn/nnnn) 
field.
if: mid(hb,"1","2") lt "01" or mid(hb,"1","2") gt "13"
then:mid(hb,"1","2")="??

if    :(mid(hb,"4","2") lt "01" or mid(hb,"4","2") gt "31"
then:mid(hb,"4","2")="??"

if   :(mid(hb,"7","4") lt "1990" or mid(hb,"7","4") gt mid(@T4,"7","4")
then:mid(hb,"7","4")="????"

Now place this value into the real field with the nn/nn/nnnn edit.

When reporting and you need to sort, use -V processing to convert the 
real date to (8,yymd)
he(8,yymd)=realfield+"0"
hc=he

and switch the other nn/nn/nnnn field
hd(8)=xlate(realfield,"?","0");

hc(8)=mid(hd,"7","4"){mid(hd,"1","2"){mid(mid(hd,"4","2")

Then sort by field hc.  The value you show on your report would be the 
actual value of the real date field or the value of the nn/nn/nnnn field.

This should put your records near the correct date range.

Hope this helps,

Richard



On 10/6/2015 12: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,
>
>   
>
> Thanks,
>
> Stanley
>
>   
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20151006/1c456863/attachment.html>
> _______________________________________________
> 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