Announcement

Collapse
No announcement yet.

Process beetwen dates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Process beetwen dates



    Hi all

    I have to process some data beetwen range dates

    Example:
    a)JAN 2004 to DEC 2004
    b)JAN 2004 to FEB 2005


    In a database the data field is: date type

    When I process in a same year (a), I don't have trouble, but when I proce=
    ss=20
    (b) only process 2005

    I try it of several MvIF filter and not work.. :(


    1)
    <MvIF EXPR=3D"{
    (alias.d.DAY_month $ alias.d.DAY_year) GE (l.start_month $ l.start_year) =
    AND=20
    (alias.d.DAY_month $ alias.d.DAY_year) LE ( l.month $ l.year) =20
    }">

    2)
    <MvIF EXPR=3D"{
    (alias.d.DAY_month GE l.start_month ) AND=20
    (alias.d.DAY_year GE l.start_year) AND=20
    (alias.d.DAY_month LE l.month) AND
    (alias.d.DAY_year LE l.year) }">


    I try either inverting month and year..

    What is the procedure correct?

    Thank's for your advance


    Roberto Buccino
    IT Developer
    ______________________________
    Alfa Centauro Custom System
    Copahue 3480 Melipal
    (02944) 44 11 88 / 15 60 3287
    ______________________________
    San Carlos de Bariloche - Rio Negro
    Patagonia - Argentina=20
    <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>



    #2
    Process beetwen dates



    Roberto,
    Personally, I would convert the dates to time_t value and compare the =
    values
    that way.

    HTH
    Bill M.

    > -----Original Message-----
    > From: [email protected]=20
    > [mailto:[email protected]] On Behalf Of Roberto Buccino
    > Sent: Saturday, February 26, 2005 10:05 AM
    > To: [email protected]
    > Subject: [meu] Process beetwen dates
    >=20
    >=20
    > Hi all
    >=20
    > I have to process some data beetwen range dates
    >=20
    > Example:
    > a)JAN 2004 to DEC 2004
    > b)JAN 2004 to FEB 2005
    >=20
    >=20
    > In a database the data field is: date type
    >=20
    > When I process in a same year (a), I don't have trouble, but=20
    > when I process=20
    > (b) only process 2005
    >=20
    > I try it of several MvIF filter and not work.. :(
    >=20
    >=20
    > 1)
    > <MvIF EXPR=3D"{
    > (alias.d.DAY_month $ alias.d.DAY_year) GE (l.start_month $=20
    > l.start_year) AND=20
    > (alias.d.DAY_month $ alias.d.DAY_year) LE ( l.month $ l.year) =20
    > }">
    >=20
    > 2)
    > <MvIF EXPR=3D"{
    > (alias.d.DAY_month GE l.start_month ) AND=20
    > (alias.d.DAY_year GE l.start_year) AND=20
    > (alias.d.DAY_month LE l.month) AND
    > (alias.d.DAY_year LE l.year) }">
    >=20
    >=20
    > I try either inverting month and year..
    >=20
    > What is the procedure correct?
    >=20
    > Thank's for your advance
    >=20
    >=20
    > Roberto Buccino
    > IT Developer
    > ______________________________
    > Alfa Centauro Custom System
    > Copahue 3480 Melipal
    > (02944) 44 11 88 / 15 60 3287
    > ______________________________
    > San Carlos de Bariloche - Rio Negro
    > Patagonia - Argentina=20
    > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
    >=20
    >=20

    Comment


      #3
      Process beetwen dates



      Hi,

      Are you compiling your script? Date type fields do not work properly in
      compiled scripts.

      Someone else mentioned using time_T values, or what I like to do is make
      my date fields like this:

      date char(14)

      Then I put YYYYMMDDHHMMSS in them and it's really easy to search, sort,
      and apply filters.

      I use a nifty little function to assign that value for me:

      <MvFUNCTION NAME = "assign_time" PARAMETERS = "">
      <MvFUNCRETURN VALUE = "{ s.dyn_tm_year $ padl(s.dyn_tm_mon,2,'0') $
      padl(s.dyn_tm_mday,2,'0') $ padl(s.dyn_tm_hour,2,'0') $
      padl(s.dyn_tm_min,2,'0') $ padl(s.dyn_tm_sec,2,'0')}">
      </MvFUNCTION>

      Maybe this will help.

      Scot

      Roberto Buccino wrote:
      > Hi all
      >
      > I have to process some data beetwen range dates
      >
      > Example:
      > a)JAN 2004 to DEC 2004
      > b)JAN 2004 to FEB 2005
      >
      >
      > In a database the data field is: date type
      >
      > When I process in a same year (a), I don't have trouble, but when I process
      > (b) only process 2005
      >
      > I try it of several MvIF filter and not work.. :(
      >
      >
      > 1)
      > <MvIF EXPR="{
      > (alias.d.DAY_month $ alias.d.DAY_year) GE (l.start_month $ l.start_year) AND
      > (alias.d.DAY_month $ alias.d.DAY_year) LE ( l.month $ l.year)
      > }">
      >
      > 2)
      > <MvIF EXPR="{
      > (alias.d.DAY_month GE l.start_month ) AND
      > (alias.d.DAY_year GE l.start_year) AND
      > (alias.d.DAY_month LE l.month) AND
      > (alias.d.DAY_year LE l.year) }">
      >
      >
      > I try either inverting month and year..
      >
      > What is the procedure correct?
      >
      > Thank's for your advance
      >
      >
      > Roberto Buccino
      > IT Developer
      > ______________________________
      > Alfa Centauro Custom System
      > Copahue 3480 Melipal
      > (02944) 44 11 88 / 15 60 3287
      > ______________________________
      > San Carlos de Bariloche - Rio Negro
      > Patagonia - Argentina
      > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
      >
      >

      Comment


        #4
        Process beetwen dates



        Hi,

        I would really use s.dyn_time_t var to make my time filters works. You have
        only to "translate" your time query (from normal time 2 unix time) and all
        the rest is piece of cake

        > I have to process some data beetwen range dates
        >
        > Example:
        > a)JAN 2004 to DEC 2004
        > b)JAN 2004 to FEB 2005

        -> Here you will have

        <mvassign name="l.start_time" value="{mktime_t(2004,1,1,0,0,0,timezone())}">
        <mvassign name="l.end_time" value="{mktime_t(2005,2,1,0,0,0,timezone())}">

        And all you have to to is to filter betwen l.start_time and l.end_time ..
        And of course in your database you will have to use only s.dyn_time_t to
        specifify the date.

        Best regards,
        Claudiu Bischoff




        -----Original Message-----
        From: [email protected] [mailto:[email protected]]On
        Behalf Of Scot Ranney
        Sent: samedi 26 février 2005 18:28
        To: Roberto Buccino
        Cc: [email protected]
        Subject: Re: [meu] Process beetwen dates


        Hi,

        Are you compiling your script? Date type fields do not work properly in
        compiled scripts.

        Someone else mentioned using time_T values, or what I like to do is make
        my date fields like this:

        date char(14)

        Then I put YYYYMMDDHHMMSS in them and it's really easy to search, sort,
        and apply filters.

        I use a nifty little function to assign that value for me:

        <MvFUNCTION NAME = "assign_time" PARAMETERS = "">
        <MvFUNCRETURN VALUE = "{ s.dyn_tm_year $ padl(s.dyn_tm_mon,2,'0') $
        padl(s.dyn_tm_mday,2,'0') $ padl(s.dyn_tm_hour,2,'0') $
        padl(s.dyn_tm_min,2,'0') $ padl(s.dyn_tm_sec,2,'0')}">
        </MvFUNCTION>

        Maybe this will help.

        Scot

        Roberto Buccino wrote:
        > Hi all
        >
        > I have to process some data beetwen range dates
        >
        > Example:
        > a)JAN 2004 to DEC 2004
        > b)JAN 2004 to FEB 2005
        >
        >
        > In a database the data field is: date type
        >
        > When I process in a same year (a), I don't have trouble, but when I
        process
        > (b) only process 2005
        >
        > I try it of several MvIF filter and not work.. :(
        >
        >
        > 1)
        > <MvIF EXPR="{
        > (alias.d.DAY_month $ alias.d.DAY_year) GE (l.start_month $ l.start_year)
        AND
        > (alias.d.DAY_month $ alias.d.DAY_year) LE ( l.month $ l.year)
        > }">
        >
        > 2)
        > <MvIF EXPR="{
        > (alias.d.DAY_month GE l.start_month ) AND
        > (alias.d.DAY_year GE l.start_year) AND
        > (alias.d.DAY_month LE l.month) AND
        > (alias.d.DAY_year LE l.year) }">
        >
        >
        > I try either inverting month and year..
        >
        > What is the procedure correct?
        >
        > Thank's for your advance
        >
        >
        > Roberto Buccino
        > IT Developer
        > ______________________________
        > Alfa Centauro Custom System
        > Copahue 3480 Melipal
        > (02944) 44 11 88 / 15 60 3287
        > ______________________________
        > San Carlos de Bariloche - Rio Negro
        > Patagonia - Argentina
        > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
        >
        >

        Comment


          #5
          Process beetwen dates



          Ooh yeah!

          Never has use before mktime.. it is not in my miva script manual

          <Mv Thank 's all boys & girls >

          ;o)

          Roberto=20

          El S=E1bado 26 Febrero 2005 14:50, Claudiu Bischoff escribi=F3:
          > Hi,
          >
          > I would really use s.dyn_time_t var to make my time filters works. You
          > have only to "translate" your time query (from normal time 2 unix time)=
          and
          > all the rest is piece of cake
          >
          > > I have to process some data beetwen range dates
          > >
          > > Example:
          > > a)JAN 2004 to DEC 2004
          > > b)JAN 2004 to FEB 2005
          >
          > -> Here you will have
          >
          > <mvassign name=3D"l.start_time"
          > value=3D"{mktime_t(2004,1,1,0,0,0,timezone())}"> <mvassign name=3D"l.en=
          d_time"
          > value=3D"{mktime_t(2005,2,1,0,0,0,timezone())}">
          >
          > And all you have to to is to filter betwen l.start_time and l.end_time=
          ..
          > And of course in your database you will have to use only s.dyn_time_t t=
          o
          > specifify the date.
          >
          > Best regards,
          > Claudiu Bischoff
          >
          >
          >
          >
          > -----Original Message-----
          > From: [email protected] [mailto:[email protected]]On
          > Behalf Of Scot Ranney
          > Sent: samedi 26 f=E9vrier 2005 18:28
          > To: Roberto Buccino
          > Cc: [email protected]
          > Subject: Re: [meu] Process beetwen dates
          >
          >
          > Hi,
          >
          > Are you compiling your script? Date type fields do not work properly i=
          n
          > compiled scripts.
          >
          > Someone else mentioned using time_T values, or what I like to do is mak=
          e
          > my date fields like this:
          >
          > date char(14)
          >
          > Then I put YYYYMMDDHHMMSS in them and it's really easy to search, sort,
          > and apply filters.
          >
          > I use a nifty little function to assign that value for me:
          >
          > <MvFUNCTION NAME =3D "assign_time" PARAMETERS =3D "">
          > =09<MvFUNCRETURN VALUE =3D "{ s.dyn_tm_year $ padl(s.dyn_tm_mon,2,'0') =
          $
          > padl(s.dyn_tm_mday,2,'0') $ padl(s.dyn_tm_hour,2,'0') $
          > padl(s.dyn_tm_min,2,'0') $ padl(s.dyn_tm_sec,2,'0')}">
          > </MvFUNCTION>
          >
          > Maybe this will help.
          >
          > Scot
          >
          > Roberto Buccino wrote:
          > > Hi all
          > >
          > > I have to process some data beetwen range dates
          > >
          > > Example:
          > > a)JAN 2004 to DEC 2004
          > > b)JAN 2004 to FEB 2005
          > >
          > >
          > > In a database the data field is: date type
          > >
          > > When I process in a same year (a), I don't have trouble, but when I
          >
          > process
          >
          > > (b) only process 2005
          > >
          > > I try it of several MvIF filter and not work.. :(
          > >
          > >
          > > 1)
          > > <MvIF EXPR=3D"{
          > > (alias.d.DAY_month $ alias.d.DAY_year) GE (l.start_month $ l.start_ye=
          ar)
          >
          > AND
          >
          > > (alias.d.DAY_month $ alias.d.DAY_year) LE ( l.month $ l.year)
          > > }">
          > >
          > > 2)
          > > <MvIF EXPR=3D"{
          > > (alias.d.DAY_month GE l.start_month ) AND
          > > (alias.d.DAY_year GE l.start_year) AND
          > > (alias.d.DAY_month LE l.month) AND
          > > (alias.d.DAY_year LE l.year) }">
          > >
          > >
          > > I try either inverting month and year..
          > >
          > > What is the procedure correct?
          > >
          > > Thank's for your advance
          > >
          > >
          > > Roberto Buccino
          > > IT Developer
          > > ______________________________
          > > Alfa Centauro Custom System
          > > Copahue 3480 Melipal
          > > (02944) 44 11 88 / 15 60 3287
          > > ______________________________
          > > San Carlos de Bariloche - Rio Negro
          > > Patagonia - Argentina
          > > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
          > >
          > >

          Comment


            #6
            Process beetwen dates



            I found Mktime.. in my manual..

            =3D )



            Roberto Buccino
            IT Developer
            ______________________________
            Alfa Centauro Custom System
            Copahue 3480 Melipal
            (02944) 44 11 88 / 15 60 3287
            ______________________________
            San Carlos de Bariloche - Rio Negro
            Patagonia - Argentina=20
            <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>


            Comment

            Working...
            X