-5

I am trying to get the last value of a field that has been answered more than once

Ex.

name time of entry mood
Duck,Daisy 2023-08-24 00.00.00:000 angry
Duck,Daisy 2023-08-24 10.00.00:000 good

I want only the last value entered to show on report.

Thank you for any assistance

Right now, I have both rows displaying on output

SelVazi
  • 10,028
  • 2
  • 13
  • 29
DJT
  • 1
  • 1
  • 3
    Just an FYI, you should always tag your DBMS in these questions. In response for the question, this can be done either by selecting the record with the `MAX()` time of entry or by ordering on the time of entry column and using your DBMS's version of `TOP`. – Austin Aug 24 '23 at 13:00
  • Which database are you using? Some have a proprietary way to handle this type of scenario – Ortiga Aug 24 '23 at 13:05
  • You should write a WHERE clause that matches your criterion for "last". Is it "last INSERT"? Ordered by something else? – duffymo Aug 24 '23 at 13:28
  • Which database are you using? MySql Or MSSQL ? – Dhiarj Sharma Aug 24 '23 at 13:31
  • Thank you all for your tips. I will be trying this soon. MSSQL – DJT Aug 25 '23 at 15:03

0 Answers0