
Quote from joferar333 on October 3, 2021, 6:26 pmLa verdad no se si sera posible peero hasta el momento no logro darme cuenta como hacerlo... por ello si alguien que lee tiene alguna sugerencia bienvenida!
El tema es poder saber entre dos fechas dadas cuantos dias hay DOMINGO
El caso practico es:
ingreso la cantidad de dias ej (45)
y la fecha de inicio que la determino usando asdatepicker.
con estos dos datos utilizo un plug de Davidesperalta que incrementa las fechas, esto seria a la fecha inicial le incremento el numero de dias y el resultado que obtengo es perfecto la fecha final 45 dias incrementados pero el problema es que deben exluirse los domingos sabiendo cuantos domingos hay entre las dos fechas la inicial y la incrementada final poder sumar esos domingos para que quede finalmente el resultado necesario.
Se aplica al cobro de cuotas diarias pero los domingos no cuentan es por ello que para poder determinar cuando inicia el ciclo y cuando terminara me es imperativo saber cuantos domingos contiene la franja de datos que he obtenido.
Alguna Idea?
ENGLISH
The truth is I don't know if it will be possible but so far I can't figure out how to do it ... so if someone who reads has a welcome suggestion! The issue is to be able to know between two dates given how many days there are SUNDAY The practical case is: input the number of days ex (45) and the start date that I determine it using asdatepicker. With these two data I use a Davidesperalta plug that increases the dates, this would be to the initial date I increased the number of days and the result I get is perfect the final date 45 days increased but the problem is that Sundays should be excluded knowing how many Sundays there are between the two dates the initial and the final increased to be able to add those Sundays so that the necessary result is finally left. It applies to the collection of daily fees but Sundays do not count, that is why in order to determine when the cycle starts and when it will end it is imperative for me to know how many Sundays the data strip that I have obtained contains. Any ideas?
Saludos Cordiales
La verdad no se si sera posible peero hasta el momento no logro darme cuenta como hacerlo... por ello si alguien que lee tiene alguna sugerencia bienvenida!
El tema es poder saber entre dos fechas dadas cuantos dias hay DOMINGO
El caso practico es:
ingreso la cantidad de dias ej (45)
y la fecha de inicio que la determino usando asdatepicker.
con estos dos datos utilizo un plug de Davidesperalta que incrementa las fechas, esto seria a la fecha inicial le incremento el numero de dias y el resultado que obtengo es perfecto la fecha final 45 dias incrementados pero el problema es que deben exluirse los domingos sabiendo cuantos domingos hay entre las dos fechas la inicial y la incrementada final poder sumar esos domingos para que quede finalmente el resultado necesario.
Se aplica al cobro de cuotas diarias pero los domingos no cuentan es por ello que para poder determinar cuando inicia el ciclo y cuando terminara me es imperativo saber cuantos domingos contiene la franja de datos que he obtenido.
Alguna Idea?
ENGLISH
The truth is I don't know if it will be possible but so far I can't figure out how to do it ... so if someone who reads has a welcome suggestion! The issue is to be able to know between two dates given how many days there are SUNDAY The practical case is: input the number of days ex (45) and the start date that I determine it using asdatepicker. With these two data I use a Davidesperalta plug that increases the dates, this would be to the initial date I increased the number of days and the result I get is perfect the final date 45 days increased but the problem is that Sundays should be excluded knowing how many Sundays there are between the two dates the initial and the final increased to be able to add those Sundays so that the necessary result is finally left. It applies to the collection of daily fees but Sundays do not count, that is why in order to determine when the cycle starts and when it will end it is imperative for me to know how many Sundays the data strip that I have obtained contains. Any ideas?
Saludos Cordiales
Quote from Gaev on October 3, 2021, 7:04 pm@joferar333
You can do a loop (from start date), checking each incremental date for it being a Sunday or not, until desired number of non-Sundays are encountered.
Something like this ..
1) Do a DateToNum on your start date; store result in [thisDateToNum]
2) Setup desired daysDifference in a variable e.g. [daysToGo]
3) Inside a While/EndWhile loop ...
a) Do a NumToDate on [thisDateNum], with format being 'ddd'
b) If the result is NOT Sun (or whatever it is in your language), subtract one from [daysToGo]
c) If [daysToGo] = zero, ExitWhile
d) Add 1 to [thisDateToNum]
When you exit the While Loop, do a NumToDate on [thisDateNum].
If you run into difficulties, post your code here, along with nature of problem.
You can do a loop (from start date), checking each incremental date for it being a Sunday or not, until desired number of non-Sundays are encountered.
Something like this ..
1) Do a DateToNum on your start date; store result in [thisDateToNum]
2) Setup desired daysDifference in a variable e.g. [daysToGo]
3) Inside a While/EndWhile loop ...
a) Do a NumToDate on [thisDateNum], with format being 'ddd'
b) If the result is NOT Sun (or whatever it is in your language), subtract one from [daysToGo]
c) If [daysToGo] = zero, ExitWhile
d) Add 1 to [thisDateToNum]
When you exit the While Loop, do a NumToDate on [thisDateNum].
If you run into difficulties, post your code here, along with nature of problem.

Quote from CN_Iceman on October 3, 2021, 7:08 pm@joferar333
Con el plugin npUtil de David Esperalta y el comando npDaysBetweenEx puedes saber eso perfectamente.
Si usas esta linea: npDaysBetweenEx "[Fecha_Inicio]" "[Fecha_Final]" "[Dias_Semana]"
El resultado será una matriz de 7 valores, en donde el 0 es el lunes y el 6 es el domingo, y cuyos valores serán la cantidad.
Por ejemplo, entre el 01/01/2021 y hoy 03/10/2021 hay 275 días y la matriz quedaría así:Dias_Semana0=39
Dias_Semana1=39
Dias_Semana2=39
Dias_Semana3=39
Dias_Semana4=40
Dias_Semana5=40
Dias_Semana6=40Por lo tanto, hay 40 domingos.
With David Esperalta's npUtil plugin and the npDaysBetweenEx command you can know that perfectly well.
If you use this line: npDaysBetweenEx "[Start_Date]" "[End_Date]" "[Week_Days]"
The result will be an array of 7 values, where 0 is Monday and 6 is Sunday, and whose values will be the quantity.
For example, between 01/01/2021 and today 03/10/2021 there are 275 days and the matrix would look like this:Week_Days0=39
Week_Days1=39
Week_Days2=39
Week_Days3=39
Week_Days4=40
Week_Days5=40
Week_Days6=40Therefore, there are 40 Sundays.
Con el plugin npUtil de David Esperalta y el comando npDaysBetweenEx puedes saber eso perfectamente.
Si usas esta linea: npDaysBetweenEx "[Fecha_Inicio]" "[Fecha_Final]" "[Dias_Semana]"
El resultado será una matriz de 7 valores, en donde el 0 es el lunes y el 6 es el domingo, y cuyos valores serán la cantidad.
Por ejemplo, entre el 01/01/2021 y hoy 03/10/2021 hay 275 días y la matriz quedaría así:
Dias_Semana0=39
Dias_Semana1=39
Dias_Semana2=39
Dias_Semana3=39
Dias_Semana4=40
Dias_Semana5=40
Dias_Semana6=40
Por lo tanto, hay 40 domingos.
With David Esperalta's npUtil plugin and the npDaysBetweenEx command you can know that perfectly well.
If you use this line: npDaysBetweenEx "[Start_Date]" "[End_Date]" "[Week_Days]"
The result will be an array of 7 values, where 0 is Monday and 6 is Sunday, and whose values will be the quantity.
For example, between 01/01/2021 and today 03/10/2021 there are 275 days and the matrix would look like this:
Week_Days0=39
Week_Days1=39
Week_Days2=39
Week_Days3=39
Week_Days4=40
Week_Days5=40
Week_Days6=40
Therefore, there are 40 Sundays.

Quote from joferar333 on October 3, 2021, 9:01 pmAmigo eternamente agradecido no tienes idea lo que acabas de hacer...
Realmente me salvaste la vida, gracias estaba bloqueado y ademas si bien tengo comprado el nputil de david el solo hecho de estar en ingles hay veces que ni alcanzo a entnder ni la mitad de los poderosos recursos fijate que esto estaba a la mano y no lo veia.
Gracias nuevamente un cordial saludo para ti y para Gaev que aprecio su ayuda solo que quizas no pude probarla porque no entendi muy bien por problemas de idioma.
Amigo eternamente agradecido no tienes idea lo que acabas de hacer...
Realmente me salvaste la vida, gracias estaba bloqueado y ademas si bien tengo comprado el nputil de david el solo hecho de estar en ingles hay veces que ni alcanzo a entnder ni la mitad de los poderosos recursos fijate que esto estaba a la mano y no lo veia.
Gracias nuevamente un cordial saludo para ti y para Gaev que aprecio su ayuda solo que quizas no pude probarla porque no entendi muy bien por problemas de idioma.

Quote from joferar333 on October 3, 2021, 9:38 pmQuizas te voy a preguntar una tontera pero no me doy cuenta en que le estoy herrando...
lo que me indicaste funciona perfecto ahora puedo localizar cuantos domingos estan contenidos entre las dos fechas
Pero no puedo lograr que este valor
Dias_Semana0=39 sea una variable para que me sume los domingos e incremente la fecha inicial para obtener la fecha final con el incremento de los dias domingos
este es mi scriptMath "[total_cuotas]+1" "0" "[inicial]"
dec_IncrementarDecrementarFecha "[ComboDate1]" "[inicial]"
npDaysBetweenEx "[ComboDate1]" "[dec_Resultado]" "[Dias_Semana]"
Math "[inicial]+[Dias_Semana0]" "0" "[pro]"
dec_IncrementarDecrementarFecha "[ComboDate1]" "[pro]"
En que le estoy herrando
Mil gracias de antemano
Quizas te voy a preguntar una tontera pero no me doy cuenta en que le estoy herrando...
lo que me indicaste funciona perfecto ahora puedo localizar cuantos domingos estan contenidos entre las dos fechas
Pero no puedo lograr que este valor
Dias_Semana0=39 sea una variable para que me sume los domingos e incremente la fecha inicial para obtener la fecha final con el incremento de los dias domingos
este es mi script
Math "[total_cuotas]+1" "0" "[inicial]"
dec_IncrementarDecrementarFecha "[ComboDate1]" "[inicial]"
npDaysBetweenEx "[ComboDate1]" "[dec_Resultado]" "[Dias_Semana]"
Math "[inicial]+[Dias_Semana0]" "0" "[pro]"
dec_IncrementarDecrementarFecha "[ComboDate1]" "[pro]"
En que le estoy herrando
Mil gracias de antemano

Quote from CN_Iceman on October 4, 2021, 10:05 am@joferar333
Hola Alejandro. Como todos aquí, es un placer ayudar, y yo he hecho muy poco.Ah! recuerda que si en la configuración de tu sistema la semana empieza en Lunes, la variable "Dias_Semana0" es la que representa los Lunes, y "Dias_Semana6" te da como valor los Domingos.
En cuanto a tu problema... no termino de entender bien que es lo que quieres hacer.
Ahora mismo estoy en el trabajo y no tengo aquí mi portátil para probar el código, así que hasta esta tarde no podré ayudarte más. De todas formas, hasta donde yo veo, lo que quieres es que teniendo una fecha inicial y un número de domingos ¿calcular la fecha final?
Creo que necesito un punto de vista más global. Es decir, necesitaría saber concretamente qué es lo que quieres hacer, cual es el objetivo final. Como ya digo, con la información que pones no termino de comprender lo que estás intentando obtener.
Saludos.
@ joferar333
Hello Alejandro. Like everyone here, it is a pleasure to help, and I have done very little.Ah! Remember that if in your system configuration the week starts on Monday, the variable "Week_Days0" is the one that represents Monday, and "Week_Days6" gives you Sundays as the value.
As for your problem ... I can't quite understand what you want to do.
Right now I'm at work and I don't have my laptop here to test the code, so I won't be able to help you anymore until this afternoon. Anyway, as far as I can see, what you want is that having an initial date and a number of Sundays, calculate the end date?
I think I need a more global point of view. That is, you need to know specifically what you want to do, what is the end goal. As I said, with the information you put in I can't quite understand what you are trying to obtain.
Greetings.
@joferar333
Hola Alejandro. Como todos aquí, es un placer ayudar, y yo he hecho muy poco.
Ah! recuerda que si en la configuración de tu sistema la semana empieza en Lunes, la variable "Dias_Semana0" es la que representa los Lunes, y "Dias_Semana6" te da como valor los Domingos.
En cuanto a tu problema... no termino de entender bien que es lo que quieres hacer.
Ahora mismo estoy en el trabajo y no tengo aquí mi portátil para probar el código, así que hasta esta tarde no podré ayudarte más. De todas formas, hasta donde yo veo, lo que quieres es que teniendo una fecha inicial y un número de domingos ¿calcular la fecha final?
Creo que necesito un punto de vista más global. Es decir, necesitaría saber concretamente qué es lo que quieres hacer, cual es el objetivo final. Como ya digo, con la información que pones no termino de comprender lo que estás intentando obtener.
Saludos.
@ joferar333
Hello Alejandro. Like everyone here, it is a pleasure to help, and I have done very little.
Ah! Remember that if in your system configuration the week starts on Monday, the variable "Week_Days0" is the one that represents Monday, and "Week_Days6" gives you Sundays as the value.
As for your problem ... I can't quite understand what you want to do.
Right now I'm at work and I don't have my laptop here to test the code, so I won't be able to help you anymore until this afternoon. Anyway, as far as I can see, what you want is that having an initial date and a number of Sundays, calculate the end date?
I think I need a more global point of view. That is, you need to know specifically what you want to do, what is the end goal. As I said, with the information you put in I can't quite understand what you are trying to obtain.
Greetings.

Quote from joferar333 on October 4, 2021, 11:59 amUna vez más gracias! (no hace falta que me respondas en ingles yo hablo solo español, puse en ingles por las dudas porque acá la mayoría se maneja con este idioma, pero por suerte tu entiendes mi idioma
Te comento que es lo que quiero lograr.
Estoy haciendo un pequeño proyecto que me permita manejar prestamos de dinero.
Los prestamos pueden ser con retorno diario o semanal.
En el caso del retorno diario (pago por dia)
En el alta del cliente entre otros datos se ingresa la cantidad de cuotas (diarias que devolvera) por ejemplo 35 cuotas
La fecha que inicia los pagos y lo que debo obtener ahí es la fecha que finalizaran los pagos
Entonces hago esto.
a la fecha que selecciono y tomo con el asdatapicker le incremento la fecha la cantidad de cuotas (utilizo npUtil)
npIncrementDate "[ComboDate1]" "days" "[total_cuotas]" "[fecha_final1]"
-- la variable "[ComboDate1]" es la que contiene la fecha inicial y la variable "[fecha_final1]" es la fecha resultante al incrementar la fecha inicial en la cantidad de dias que toma de la cantidad de cuotas del prestamo.
Ahora bien los cobros y pagos son de lunes a sabado por lo que en esa fecha obtenida se encuentran incluidos domingos, por
esto es que debo excluir la cantidad de domingos que estén contenidos en la fecha final y a su vez incrementar el numero de cuotas como domingo reste para obtener una nueva fecha final ya sin los domingos.(como se que día comienza en mi maquina, como puedo obtener este dato?)
Bien volviendo al proyecto para lograr lo que te describí hago esto.
IpincrementDate "[ComboDate1]" "days" "[total_cuotas]" "[fecha_final1]"
npDaysBetweenEx "[ComboDate1]" "[fecha_final1]" "[Dias_Semana]"
Math "[total_cuotas]+[Dias_Semana6]" "" "[total_incremento]"
npIncrementDate "[ComboDate1]" "days" "[total_incremento]" "[fecha_final2]"
Ahora la fecha final que obtengo puede segun el caso haber incrementado el numero de domingos desde la fecha inicial
hasta esta nueva final... y aca es donde ahora me ahogo...Deberia iniciar nuevamente todo el proceso con la fecha inicial y la cantidad de cuotas incrementadas por el resultado de la variable [dias_Semana6] ? o alguna idea de como hacer para finalizar y obtener entre la fecha final y la final de acuerdo al numero de cuotas una fecha final sin domingos.
Luego este mismo proceso voy a tener que hacerlo para obtener la fecha inicial y final de la cantidad de cuotas de un prestamo con retorno semanal....
No se si ahora esta bien explicado pero esto es en si el objetivo.
Gracias saludos!
Una vez más gracias! (no hace falta que me respondas en ingles yo hablo solo español, puse en ingles por las dudas porque acá la mayoría se maneja con este idioma, pero por suerte tu entiendes mi idioma
Te comento que es lo que quiero lograr.
Estoy haciendo un pequeño proyecto que me permita manejar prestamos de dinero.
Los prestamos pueden ser con retorno diario o semanal.
En el caso del retorno diario (pago por dia)
En el alta del cliente entre otros datos se ingresa la cantidad de cuotas (diarias que devolvera) por ejemplo 35 cuotas
La fecha que inicia los pagos y lo que debo obtener ahí es la fecha que finalizaran los pagos
Entonces hago esto.
a la fecha que selecciono y tomo con el asdatapicker le incremento la fecha la cantidad de cuotas (utilizo npUtil)
npIncrementDate "[ComboDate1]" "days" "[total_cuotas]" "[fecha_final1]"
-- la variable "[ComboDate1]" es la que contiene la fecha inicial y la variable "[fecha_final1]" es la fecha resultante al incrementar la fecha inicial en la cantidad de dias que toma de la cantidad de cuotas del prestamo.
Ahora bien los cobros y pagos son de lunes a sabado por lo que en esa fecha obtenida se encuentran incluidos domingos, por
esto es que debo excluir la cantidad de domingos que estén contenidos en la fecha final y a su vez incrementar el numero de cuotas como domingo reste para obtener una nueva fecha final ya sin los domingos.
(como se que día comienza en mi maquina, como puedo obtener este dato?)
Bien volviendo al proyecto para lograr lo que te describí hago esto.
IpincrementDate "[ComboDate1]" "days" "[total_cuotas]" "[fecha_final1]"
npDaysBetweenEx "[ComboDate1]" "[fecha_final1]" "[Dias_Semana]"
Math "[total_cuotas]+[Dias_Semana6]" "" "[total_incremento]"
npIncrementDate "[ComboDate1]" "days" "[total_incremento]" "[fecha_final2]"
Ahora la fecha final que obtengo puede segun el caso haber incrementado el numero de domingos desde la fecha inicial
hasta esta nueva final... y aca es donde ahora me ahogo...
Deberia iniciar nuevamente todo el proceso con la fecha inicial y la cantidad de cuotas incrementadas por el resultado de la variable [dias_Semana6] ? o alguna idea de como hacer para finalizar y obtener entre la fecha final y la final de acuerdo al numero de cuotas una fecha final sin domingos.
Luego este mismo proceso voy a tener que hacerlo para obtener la fecha inicial y final de la cantidad de cuotas de un prestamo con retorno semanal....
No se si ahora esta bien explicado pero esto es en si el objetivo.
Gracias saludos!

Quote from CN_Iceman on October 4, 2021, 1:46 pmHola de nuevo Alejandro.
Si contesto en Español (mi idioma también) y en Inglés es porque así es más fácil de entender para más gente en el foro y de esa forma más gente puede ayudar.
Gracias por toda la información que me cuentas. Hay bastante que procesar. Esta tarde con calma le echaré un vistazo y a ver si puedo decirte algo. Quizás con suerte nuestros amigos del foro ya estarán preparándote alguna idea.
Un saludo.
Hello again Alejandro.
If I answer in Spanish (my language too) and in English it is because that way it is easier for more people in the forum to understand and that way more people can help.
Thanks for all the information you tell me. There is a lot to process. This afternoon I will calmly take a look at it and see if I can tell you something. Perhaps hopefully our friends on the forum will already be preparing an idea for you.
All the best.
Hola de nuevo Alejandro.
Si contesto en Español (mi idioma también) y en Inglés es porque así es más fácil de entender para más gente en el foro y de esa forma más gente puede ayudar.
Gracias por toda la información que me cuentas. Hay bastante que procesar. Esta tarde con calma le echaré un vistazo y a ver si puedo decirte algo. Quizás con suerte nuestros amigos del foro ya estarán preparándote alguna idea.
Un saludo.
Hello again Alejandro.
If I answer in Spanish (my language too) and in English it is because that way it is easier for more people in the forum to understand and that way more people can help.
Thanks for all the information you tell me. There is a lot to process. This afternoon I will calmly take a look at it and see if I can tell you something. Perhaps hopefully our friends on the forum will already be preparing an idea for you.
All the best.

Quote from CN_Iceman on October 4, 2021, 7:31 pm@joferar333
Hola Alejandro.
Buffff.... me ha costado entender lo que quieres.
.Incrementa el nº de días desde la Fecha_Inicio según las cuotas npIncrementDate "[Fecha_Inicio]" "days" "[Total_cuotas]" "[Fecha_Final]" .Calculamos el número de Lun,Mar,Mie,Jue,Vie,Sab,Dom entre las 2 fechas npDaysBetweenEx "[Fecha_Inicio]" "[Fecha_Final]" "[Num_Dias_]" .Calculamos el número de días entre las dos fechas npDaysBetween "[Fecha_Inicio]" "[Fecha_Final]" "[Num_Dias]" .Sumamos el número de domingos entre esas dos fechas Math "[Num_Dias]+[Num_Dias_6]" "0" "[Num_Dias_mas_Domingos]" .Recalculamos nueva fecha npIncrementDate "[Fecha_Inicio]" "days" "[Num_Dias_mas_Domingos]" "[Nueva_Fecha_Final]"Lo que he hecho aquí, es primero incrementar la fecha de inicio con el número de cuotas para tener una fecha final. Ahí, calculo el número de Lunes, Martes, Miércoles, Jueves, Viernes, Sábados y Domingos que hay entre las dos fechas. Para asegurarme, también obtengo el número de días que hay entre las dos fechas (que tiene que coincidir con el número de cuotas).
Vale, ahora sumamos el número de domingos que hay entre las fechas de inicio y final y lo sumo para calcular una nueva fecha final.
El resultado de la variable "[Nueva_Fecha_Final]" sería el que buscas ¿no?
Hi Alejandro.
Buffff.... it was hard for me to understand what you want.
.It increases the number of days from the Start_Date according to the quotas. npIncrementDate "[Start_Date]" "days" "[Total_Quotas]" "[End_Date]" .We calculate the number of Mon,Tue,Wed,Thur,Fri,Sat,Sun between the 2 dates npDaysBetweenEx "[Start_date]" "[End_date]" "[Number_of_Days_]" .Calculate the number of days between the two dates npDaysBetween "[Start_Date]" "[End_Date]" "[Days_Number]" "[Days_Num]" .Add the number of Sundays between these two dates. Math "[Num_Days_Number]+[Num_Days_6]" "0" "[Num_Days_Most_Sundays_More_Sundays]" .Recalculate new date npIncrementDate "[Start_Date]" "days" "[Num_Days_Most_Sundays]" "[New_End_Date]"What I have done here, is first increment the start date with the number of installments to have an end date. There, I calculate the number of Mondays, Tuesdays, Wednesdays, Thursdays, Fridays, Saturdays and Sundays between the two dates. To make sure, I also get the number of days between the two dates (which has to match the number of installments).
Okay, now we add up the number of Sundays between the start and end dates and I add it up to calculate a new end date.
The result of the variable "[New_End_Date]" would be the one you are looking for, right?
Hola Alejandro.
Buffff.... me ha costado entender lo que quieres.
.Incrementa el nº de días desde la Fecha_Inicio según las cuotas npIncrementDate "[Fecha_Inicio]" "days" "[Total_cuotas]" "[Fecha_Final]" .Calculamos el número de Lun,Mar,Mie,Jue,Vie,Sab,Dom entre las 2 fechas npDaysBetweenEx "[Fecha_Inicio]" "[Fecha_Final]" "[Num_Dias_]" .Calculamos el número de días entre las dos fechas npDaysBetween "[Fecha_Inicio]" "[Fecha_Final]" "[Num_Dias]" .Sumamos el número de domingos entre esas dos fechas Math "[Num_Dias]+[Num_Dias_6]" "0" "[Num_Dias_mas_Domingos]" .Recalculamos nueva fecha npIncrementDate "[Fecha_Inicio]" "days" "[Num_Dias_mas_Domingos]" "[Nueva_Fecha_Final]"
Lo que he hecho aquí, es primero incrementar la fecha de inicio con el número de cuotas para tener una fecha final. Ahí, calculo el número de Lunes, Martes, Miércoles, Jueves, Viernes, Sábados y Domingos que hay entre las dos fechas. Para asegurarme, también obtengo el número de días que hay entre las dos fechas (que tiene que coincidir con el número de cuotas).
Vale, ahora sumamos el número de domingos que hay entre las fechas de inicio y final y lo sumo para calcular una nueva fecha final.
El resultado de la variable "[Nueva_Fecha_Final]" sería el que buscas ¿no?
Hi Alejandro.
Buffff.... it was hard for me to understand what you want.
.It increases the number of days from the Start_Date according to the quotas. npIncrementDate "[Start_Date]" "days" "[Total_Quotas]" "[End_Date]" .We calculate the number of Mon,Tue,Wed,Thur,Fri,Sat,Sun between the 2 dates npDaysBetweenEx "[Start_date]" "[End_date]" "[Number_of_Days_]" .Calculate the number of days between the two dates npDaysBetween "[Start_Date]" "[End_Date]" "[Days_Number]" "[Days_Num]" .Add the number of Sundays between these two dates. Math "[Num_Days_Number]+[Num_Days_6]" "0" "[Num_Days_Most_Sundays_More_Sundays]" .Recalculate new date npIncrementDate "[Start_Date]" "days" "[Num_Days_Most_Sundays]" "[New_End_Date]"
What I have done here, is first increment the start date with the number of installments to have an end date. There, I calculate the number of Mondays, Tuesdays, Wednesdays, Thursdays, Fridays, Saturdays and Sundays between the two dates. To make sure, I also get the number of days between the two dates (which has to match the number of installments).
Okay, now we add up the number of Sundays between the start and end dates and I add it up to calculate a new end date.
The result of the variable "[New_End_Date]" would be the one you are looking for, right?

Quote from joferar333 on October 4, 2021, 8:14 pmSin palabras master!!!!
Perfecto mil mil gracias
saludos
Sin palabras master!!!!
Perfecto mil mil gracias
saludos
