Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How to get the latest entry in a field? asp.net, sql

Avatar of MHenry
MHenry asked on
Microsoft SQL ServerASP.NETSQL
7 Comments1 Solution185 ViewsLast Modified:
I have a field called LongNotes and I need to get the latest entry in that field. Here's my current query:

 
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:qConnectionString %>" SelectCommand="SELECT ACCOUNT.ACCOUNTID, HISTORY.STARTDATE, HISTORY.USERNAME, HISTORY.CONTACTNAME, HISTORY.LONGNOTES FROM ACCOUNT INNER JOIN HISTORY ON ACCOUNT.ACCOUNTID = HISTORY.ACCOUNTID WHERE (ACCOUNT.ACCOUNTID = @Param1)">
             <SelectParameters>
                 <asp:QueryStringParameter Name="Param1" QueryStringField="ACCOUNTID" />
             </SelectParameters>
         </asp:SqlDataSource>

I have to get the data this way so I don't want to mess anything up. I just need to somehow get the last entry in the HISTORY.LONGNOTES field.

Any ideas? TIA!

mh
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answers