Special Date Edit
Stanley - stanlyn.com
stanley at stanlyn.com
Wed Oct 7 10:23:06 PDT 2015
Hi Richard,
>> You will agree this is a strange problem.
I think it is a bigger and more widespread problem than most people
realizes. Most invoices entered by AP clerks are current invoices and when
they run across one with an invalid date they just guess at the date to keep
it in their current accounting period and for the most part that is
acceptable. This fails if you are trying to make this as accurate as
possible and spans many accounting periods and years. This is what I'm
dealing with, even though at this point its pure archival...
I understand what you're saying, but thinking that the solution can be much
simpler by:
1. create an edit that forces a consistent 10 digit character field like
YYYY/MM/DD (reverse date), and allows for 0000/00/00 for data entry,
2. the invoice field for the date is character and will be based on this
edit,
3. store all (good and bad) dates with the edit being responsible for zero
padding the values,
4. done...
If you don't want the slashes, then leave them out of the edit and reduce
the field length by 2. If the slashes are removed from the field length and
edit, you can then use either character or numeric as its field type and
both ways will both sort and index correctly.
An index built on that field will show both good and bad invoices correctly
and in correct order.
Selecting a date range will pull what is expected, both good and bad dates.
If math needs to be done, then parse and process in the v table as has been
pointed out...
Can you see any problem with this?
Thanks,
Stanley
-----Original Message-----
From: Filepro-list
[mailto:filepro-list-bounces+stanley=stanlyn.com at lists.celestial.com] On
Behalf Of Richard D. Williams via Filepro-list
Sent: Wednesday, October 7, 2015 9:01 AM
To: filepro-list at lists.celestial.com
Subject: Re: Special Date Edit
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/20151
> 006/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
>
>
>
>
_______________________________________________
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