Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do I Pull The Latest Record?
Message
From
12/12/2006 05:32:40
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01176703
Message ID:
01176773
Views:
7
>I have a customer header and customer line items table.
>
>I want to pull the header and LATEST line item record joined
>together.
>
>How do I do this?

Kevin,
SQL server and other backends doesn't have a concept of record number as VFP (and in VFP too in fact there is no record number, it's a calculated value - but since VFP doesn't rearrange data file unless pack,sort etc is used and inserts data at the end of the file physically you may have a 'last' inserted concept there).

You must have a field storing 'last' in some way. ie: OrdItems table of VFP's testdata.dbc have lineno field to keep entry orders of line items per invoice. If you don't do that then there is no guarantee that 'latest' line item would still be 'latest' at next select.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform