|
-
Nov 30th, 2002, 08:11 AM
#1
Thread Starter
Member
Fetch last record from duplicate values
Hi, i have a sql table where there is no primary key defined on the key field (123 below) as it contains duplicates. From the below sample data if i need to know which is the last updated record what should i do ? In Foxpro the below is achieved using the scan() function.. pls help me with the query in VB as i have been struggling since long to get this up working.
Num Delvd Date Time Delay reason Entry_date Time
123 2002-09-03 0600 CUSTOM HELD NULL 2002-09-03 1209
123 2002-09-03 1600 CUSTOM HELD NULL 2002-09-03 1640
123 2002-09-04 1700 CUSTOM HELD NULL 2002-09-04 1734
123 2002-09-08 0900 CUSTOM HELD NULL 2002-09-08 1014
123 2002-09-12 1600 CUSTOM HELD NULL 2002-09-12 1635
123 2002-10-08 1500 NULL SIGN 2002-10-09 1505
-
Nov 30th, 2002, 03:06 PM
#2
PowerPoster
How about something like...
SELECT * FROM <TABLE> ORDER BY <FIELDS>
SET RS = DB.OPENRECORDSET...
IF RS.RECORDCOUTN > 0 THEN
RS.MOVELAST
ENDIF
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|