2 Replies Latest reply: Aug 5, 2011 6:25 PM by kramelot RSS

    How to establish rules generally?

      Hi Everybody.

       

      I have a table call [Crudo de Incidentes] that is compose for a lot equal tables inside, i need to use something like:

       

      Year ([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Año,

       

      Month([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Mes,

       

      Day ([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Dia,

       

      Hour ([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Hora,

       

      But i don´t want to use this in every table that i add to [Crudo de Incidentes], for this reason, How do i declare rule generally that involve all the tables in [Crudo de Incidentes] at the same time?.

       

      Best Regards

        • Re: How to establish rules generally?
          John Witherspoon

          So you're concatenating a bunch of tables with the same fields, and don't want to calculate Año, Mes, Dia and Hora over and over?

           

          This is usually handled with a Calendar table.  In this case, though, you'd still need to at least establish the Hora on the main table since you're dealing with timestamps instead of dates.

           

          In your case, I might instead wait until [Crudo de Incidentes] has been fully loaded, and then left join the dates on at the end:

           

          LEFT JOIN ([Crudo de Incidentes])
          LOAD the key field or fields to the table,
          Year ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Año,
          Month([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Mes,
          Day  ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Dia,
          Hour ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Hora
          RESIDENT [Crudo de Incidentes]
          ;