R
ragtopcaddy via AccessMonster.com
How do I return the latest date from a linked SQL Server table in a pass
through query?
through query?
John,
Thanks for you response. The problem is the date formatting on the server
table.
If I use SELECT Max( convert( varchar, [MonthEnd],101)) MonthEnd I get
12/31/2006. The actual max date is currently 03/31/2008. I should have
clarified my question.
Thanks,
John said:If you are using MS SQL server, the SQL statement should read as follows.
SELECT Max(SomeField) as LastDate
FROM SomeTable
Of course, I believe you want more than just that, but you haven't said that
you want more than that. And if so, what you do want.
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
John said:What type of field is MonthEnd? If it is a date field then you need to get the
MAX BEFORE you convert it to a string. If I am reading what you are doing
correctly, you are converting to a string and then getting the max value
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
[quoted text clipped - 21 lines]John,