subtract between two different fields

dami

Member
Local time
Yesterday, 20:04
Joined
Mar 22, 2021
Messages
65
¿Mi base tiene dos campos "mes" y otro "número de folio" como diferencia entre dos meses?
ej Enero 198030
Febrero 302105
marzo 504265
La Diferencia Entre enero y febrero, febrero y marzo, etc ... se Hace un Través de Formulario, consulta o informe ... ¿me ayudarían?
 
you can use a Query to accomplish that:
Code:
SELECT
    Table1.month,
    Table1.value,
    [value]-DSum("[value]","table1","Format$('2021-' & [month] & '-1','yyyymmdd')  = '" & Format$(DateAdd("m",-1,CDate("2021-" & [month] & "-1")),"yyyymmdd") & "'") AS Difference
FROM Table1;
 
puede usar una consulta para lograr eso:
[CÓDIGO] SELECCIONAR
Table1.month,
Table1.value,
[valor] -DSum ("[valor]", "tabla1", "Formato $ ('2021-' & [mes] & '-1', 'aaaammdd') = '" & Formato $ (DateAdd ("m" , -1, CDate ("2021-" & [mes] & "-1")), "aaaammdd") & "'") AS Diferencia
FROM Table1;
[/CÓDIGO]
Muchas gracias perdón por mi ignorancia. ¿Tengo que crear un botón dentro de un formulario y pegar ese código?
 
this is a Query but you can build a Form and make the query as the
recordsource of your form.
see this demo. Table1 has the data (see it's structure first).
now run Query1.
 

Attachments

esta es una consulta, pero puede crear un formulario y realizar la consulta como
fuente de registro de su formulario.
ver esta demostración. Table1 tiene los datos (consulte su estructura primero).
ahora ejecute Query1.
muchas gracias por su tiempo
 
Is it possible to translate this language into English , we can easily assist on this one:

¿Mi base tiene dos campos "mes" y otro "número de folio" como diferencia entre dos meses?
ej Enero 198030
Febrero 302105
marzo 504265
La Diferencia Entre enero y febrero, febrero y marzo, etc ... se Hace un Través de Formulario, consulta o informe ... ¿me ayudarían?

Probably you are looking to subtracting the previous row with the current row , then you need some sub queries for sure
 

Users who are viewing this thread

Back
Top Bottom