Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Record Selection by Current As of Date

For Unit 100 from Property 0081, I need to find ONLY the most current As of
Date and its associated Sq Footage but my query returns ALL As of Dates and
associated Sq Footage. How can I return only the most current? Thanks.

Property Unit SF Type As of Date Sq Ft

0081 100 Rentable 12/1/1996 92246
0081 100 Rentable 12/1/2001 58387
0081 100 Rentable 5/15/2008 40345

Here is my SQL query:

SELECT
"UFPROP" AS "Property",
"UFUNIT" AS "Unit",
"UFSFTYP" AS "SF type",
"UFDATE" AS "As-of Date",
"UFSF" AS "Square footage"
FROM
"PROPERTY_PMP_RECORD_19"
Where
((UFSFTYP = 'Rentable') AND (UFUNIT = '100'))

Kalli

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Record Selection by Current As of Date


MaxRe cords is not part of the SQL, it is either an option on the query
table or recordset

For record set
rstTemp.MaxRecords = 10
rstTemp.Open "SELECT Title, Price FROM Titles " & _
"ORDER BY Price DESC", strCnn, , , adCmdText
For Query table only using ODBC

With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _
"ODBC;DSN=MS Access
Database;DBQ=C:\temp\submission.mdb;MaxRecords=1;D efaultDir=C:\temp;DriverId=25;FIL=MS
Access;MaxBufferSize=5;PageTimeout=5" _
), Array(";")), Destination:=Range("D4"))


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=151895

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Record Selection by Current As of Date

If your dates are true dates (numeric) why not try =MAX(RangeOfDate) to get the
highest number = Latest date (most current?).

"KalliKay" wrote:

For Unit 100 from Property 0081, I need to find ONLY the most current As of
Date and its associated Sq Footage but my query returns ALL As of Dates and
associated Sq Footage. How can I return only the most current? Thanks.

Property Unit SF Type As of Date Sq Ft

0081 100 Rentable 12/1/1996 92246
0081 100 Rentable 12/1/2001 58387
0081 100 Rentable 5/15/2008 40345

Here is my SQL query:

SELECT
"UFPROP" AS "Property",
"UFUNIT" AS "Unit",
"UFSFTYP" AS "SF type",
"UFDATE" AS "As-of Date",
"UFSF" AS "Square footage"
FROM
"PROPERTY_PMP_RECORD_19"
Where
((UFSFTYP = 'Rentable') AND (UFUNIT = '100'))

Kalli

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I add the new record from another list to current one? PattyS Excel Worksheet Functions 1 January 10th 10 03:56 PM
Update current record in Access using Excel Noemi Excel Programming 1 February 21st 07 02:38 PM
Blocking Error 3021 No current record dbl Excel Programming 1 September 11th 05 01:57 PM
Record Selection PraxisPete Excel Programming 1 June 2nd 05 03:18 PM
Current row/record shown when opening data/form buczacz Excel Programming 8 October 22nd 03 04:31 AM


All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"