Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Thu, 29 Jan 2009 06:16:00 -0800, Joel
wrote: The command text part of the query is really a SQL command. You really want to perfrom a filter, sort, and then get the LAST RECORD (not all the records). I'm not an expert on SQL. A query has a limit number ofn the number of items to return. You can set this number to 1 and sort backwards so the last item is the first record. Maybe this: SELECT TOP 1 * FROM MyTable WHERE MyDate<=? ORDER BY MyDate DESC; -- Dick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dates in SQL query won't match | Excel Programming | |||
How do I export dates into a query? | Excel Discussion (Misc queries) | |||
How do I use variable dates with a SQL Query | Excel Programming | |||
web query in VBA (format dates in url) | Excel Programming | |||
dates in query | Excel Worksheet Functions |