coding a date range 
Author Message
 coding a date range

Hi,
I was wondering if someone has expierence with the problem I'm facing:

I've got a print logfile and I want to retrieve information from it.
I almost made it to a succes, but now I want to sort results on date.

That is, I want to specify a date range and retrieve all
information,day based.
Furthermore, I want to make a nice graph with this information, and
that's where I make my mistake because when I want to show stats per
printer I need the pagecount per day, and not all printers are active
every day, so I need a matrix a specific daterange which I can fill in
with my stats.
e.g.: from a logfile from 1/12/02 to 31/01/03
date        printer1   printer2
10/12/02       32        8
11/12/02       0         78
12/12/02       0         0
13/12/02      116        16

Does anyone know a solution to this? My problem is that I don't know
how to compensate for leapyears and month-length.

best regards,
Jasper van Dijk



Tue, 17 May 2005 20:59:27 GMT  
 coding a date range
You must change to IDN space. I.e. not use ordinary dates, but number of
days elapsed since 1.1.1900. You must have your data saved with that
identifier in the date column. Then, when you want a report from for example
1.12.2002 - 10.12.2002 you get the IDN number for both dates, then you
extract rows from your data according to a {bigger than} {and} {smaller
than} condition. Bu subtracting the IDN values, you get the number of
involved days.

To get the involved individual dates, get the 3 element TS vector for each
IDN date in the range. This will give you a Feb 29th, if that happens to be
in the range.

If you use Dyalog APL, there are the IDN system functions avaible.
/ Tomas



Quote:
> Hi,
> I was wondering if someone has expierence with the problem I'm facing:

> I've got a print logfile and I want to retrieve information from it.
> I almost made it to a succes, but now I want to sort results on date.

> That is, I want to specify a date range and retrieve all
> information,day based.
> Furthermore, I want to make a nice graph with this information, and
> that's where I make my mistake because when I want to show stats per
> printer I need the pagecount per day, and not all printers are active
> every day, so I need a matrix a specific daterange which I can fill in
> with my stats.
> e.g.: from a logfile from 1/12/02 to 31/01/03
> date        printer1   printer2
> 10/12/02       32        8
> 11/12/02       0         78
> 12/12/02       0         0
> 13/12/02      116        16

> Does anyone know a solution to this? My problem is that I don't know
> how to compensate for leapyears and month-length.

> best regards,
> Jasper van Dijk



Tue, 17 May 2005 23:17:58 GMT  
 coding a date range
I have a collection of functions for that and other date related
problems.  e.g. Date of day N days after/before given date, formatting
dates, last day of given month, etc.
        I store dates internally in the form [cc]yymmdd.  E.g. Today is
20021129.
        Mine are written for APL2.

You are welcome to a copy if you want.

      grp 'date'
DATEGRP      Cal          D_S_T        Date         Day          
Dayofyear    Days         Daysof       Fdate        FromNow      
Ftime        LastDay      Month_num    Months       Now          
Time         date_default mAdd                                  
      {floor}Now
20021129
      950501 Days{floor}Now
2769
      950501 Date 1000
19980125
      Fdate{floor}Now
2002 Nov 29

Ted



Wed, 18 May 2005 05:16:03 GMT  
 coding a date range


 > I have a collection of functions for that and other date related
 > problems.  e.g. Date of day N days after/before given date, formatting
 > dates, last day of given month, etc.
 >  I store dates internally in the form [cc]yymmdd.  E.g. Today is
 > 20021129.

Does [cc] represent century? If so, you have a bug ;).

 >  Mine are written for APL2.
 >
 > You are welcome to a copy if you want.
 >
 >       grp 'date'
 > DATEGRP      Cal          D_S_T        Date         Day          
 > Dayofyear    Days         Daysof       Fdate        FromNow      
 > Ftime        LastDay      Month_num    Months       Now          
 > Time         date_default mAdd                                  
 >       {floor}Now
 > 20021129
 >       950501 Days{floor}Now
 > 2769
 >       950501 Date 1000
 > 19980125
 >       Fdate{floor}Now
 > 2002 Nov 29

I seem to remember that the Toronto Toolkit had some date functions that
may be applicable.

--
Jerry Koniecki   wa2rkn   NO email at present. Try and spam me now!



Wed, 18 May 2005 07:06:03 GMT  
 coding a date range
Something is wrong with your reply or my ISP's handling of it.  Try
again.

Ted



Wed, 18 May 2005 11:40:17 GMT  
 coding a date range


 > I have a collection of functions for that and other date related
 > problems.  e.g. Date of day N days after/before given date, formatting
 > dates, last day of given month, etc.
 >  I store dates internally in the form [cc]yymmdd.  E.g. Today is
 > 20021129.

If [cc] is century, you have a bug.

I believe that Toronto Toolkit has date functions that may be useful.

 >  Mine are written for APL2.
 >
 > You are welcome to a copy if you want.
 >
 >       grp 'date'
 > DATEGRP      Cal          D_S_T        Date         Day          
 > Dayofyear    Days         Daysof       Fdate        FromNow      
 > Ftime        LastDay      Month_num    Months       Now          
 > Time         date_default mAdd                                  
 >       {floor}Now
 > 20021129
 >       950501 Days{floor}Now
 > 2769
 >       950501 Date 1000
 > 19980125
 >       Fdate{floor}Now
 > 2002 Nov 29

--



Thu, 19 May 2005 13:07:50 GMT  
 coding a date range
Jerry:
This is what I see when I try to look at your post:
"
News Error!

News host responded: No Such Article In Group

Perhaps the article has expired


"
I have no idea why thjis is happening.  Do you?  The same thing happened
on your previous one but not the first one.

Ted



Fri, 20 May 2005 03:22:24 GMT  
 coding a date range
I have some functions based on converting the {quad}TS vector into the
number of milliseconds from the first millisecond, finding offsets,
converting miiliseconds back to the {quad}TS vector and finally formating
alphanumerically various ways. It's the Excel format but, as you can see,
they are good for any date from day 1 to the year 19999 at which time we
need to change the calendar, anyway. They were tested by generating every
date and time from day 1 to 19999 and back without errors. There are also
versions just for days to make the use of offsets easier. These are for
APL+Win and APL+Dos but I can produce them in Jim Weigang's code for
converting if anyone wants to use them. I have found they cover almost every
situation regarding dates, especially storing and sorting them.

Fred



Fri, 20 May 2005 20:24:58 GMT  
 coding a date range
Excel bug reminder:

Note that MS Excel incorrectly assumes that 1900 was a leapyear. Thus it
thinks that TS interpretion of the IDN number 366 is 31.12.1900. The correct
interpretion is 01.01.1901. This error is accumulated in Excel's date
calculations up to current and future dates.

(Source: various Help's including Dyalog APL's)



Sat, 21 May 2005 03:44:31 GMT  
 coding a date range

Quote:

> Excel bug reminder:

Not surprising.  It's an M$ product isn't it.

Ted



Sat, 21 May 2005 09:47:16 GMT  
 coding a date range

Quote:


> > Excel bug reminder:

> Not surprising.  It's an M$ product isn't it.

The bug was not originally in Excel:
http://www-1.ibm.com/support/docview.wss?rs=0&q=year%2Bleap%2B1900&uid=s
im25059212e119d627a85256af10052c951

Excel maintained the bug for the same compatibility reasons.
http://support.microsoft.com/default.aspx?scid=kb;en-us;181370

--

Homepage: currently offline
[[LET'S GO! Tsukinuke you ze yume de mita yoake ni // Let's go, blastin'

  off into the night, towards the dawn I've only dreamed of.]]



Sat, 21 May 2005 18:41:44 GMT  
 coding a date range



Quote:

> > > Excel bug reminder:
> Excel maintained the bug for the same compatibility reasons.
> http://support.microsoft.com/default.aspx?scid=kb;en-us;181370

It bothers me that MS lists a number of "huge" problems that arises if
they'd fix the bug. Then they say that not fixing it only causes only one
single problem: Weekdays before 1.1 1901 are incorrectly handled. And since
it's rare that people use that old dates, it's a negligible thing.

Obviously they don't consider it a problem that applications connecting to
Excel, for example using OLE or files, have to build in the same bug in
order to work correctly.

Despite whatever reasons and solutions there might be, i think it smells bad
to cover the own interests that way.

So i wrote my first feedback ever to MS. In that post, i essentially told
them that they are spiritually poor people if this is the way they look at
it. I also told them that they could go and **** *** right away.



Sun, 22 May 2005 09:40:10 GMT  
 coding a date range


Quote:




>> > > Excel bug reminder:

>> Excel maintained the bug for the same compatibility reasons.
>> http://support.microsoft.com/default.aspx?scid=kb;en-us;181370

>It bothers me that MS lists a number of "huge" problems that arises if
>they'd fix the bug. Then they say that not fixing it only causes only one
>single problem: Weekdays before 1.1 1901 are incorrectly handled. And since
>it's rare that people use that old dates, it's a negligible thing.

>Obviously they don't consider it a problem that applications connecting to
>Excel, for example using OLE or files, have to build in the same bug in
>order to work correctly.

>Despite whatever reasons and solutions there might be, i think it smells bad
>to cover the own interests that way.

>So i wrote my first feedback ever to MS. In that post, i essentially told
>them that they are spiritually poor people if this is the way they look at
>it. I also told them that they could go and **** *** right away.

How about suggesting that they incorporate a "migration level" variable?
Value=0 or non-existent means it is broken (as now), 1 means it works
properly.

Excel doesn't do dates before 1900, which is also a PITA.

--
John Sullivan



Sun, 22 May 2005 16:39:15 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. DB Date Range Field Type

2. Help: Need all changes in a date-range

3. CW Browse Template Date Range & ODBC

4. problems generating a report with a date range

5. Need help on date range fot sales tax

6. Setting date Range on a report

7. HELP: SQL ODBC date range, 2nd post

8. changing date range from print station

9. Remove or Delete : range of dates

10. How many months within a date range

11. Newbie Question - Report based on range of dates

12. S87 - date range oddity

 

 
Powered by phpBB® Forum Software