Solved Get the last entered value (1 Viewer)

zelarra821

Registered User.
Local time
Today, 10:31
Joined
Jan 14, 2019
Messages
809
Goodnight.

Well, as I say in the subject, I need to get the last value from the right column (cintura). As you can see, it does not correspond to the last date entered. Until now I did it like this:

DLookup("Cintura", "T04Peso", "Fecha=#" & DMax("Fecha", "T04Peso") & "#")

But it doesn't show me any value.

How could I fix it?

Thanks!
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    369.3 KB · Views: 92

bastanu

AWF VIP
Local time
Today, 01:31
Joined
Apr 13, 2010
Messages
1,402
Actually it shows you the value for 19Feb2021 which is the latest date. If you want the latest Cintura value create a query that returns only the Not Nulls and apply your dLookup to that:
qryCinturaNotNull: "SELECT * FROM T04PESO WHERE Cintura Is Not Null;"
DLookup("Cintura", "qryCinturaNotNull", "Fecha=#" & DMax("Fecha", "qryCinturaNotNull") & "#")
Cheers,
 

zelarra821

Registered User.
Local time
Today, 10:31
Joined
Jan 14, 2019
Messages
809
OK thank you very much.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:31
Joined
May 7, 2009
Messages
19,241
just add additional condition:

DLookup("Cintura", "T04Peso", "Fecha=#" & DMax("Fecha", "T04Peso", "IsNull(Cintura) = False") & "#")
 

Users who are viewing this thread

Top Bottom