|
Posted by bwalton_707 on 11/27/07 23:27
On Nov 27, 5:34 pm, "Tony Rogerson" <tonyroger...@torver.net> wrote:
> Both are very different products.
>
> Try this...
>
> SELECT id, max( date )
> FROM anytable
> GROUP BY id
> ORDER BY id, date desc
>
> The jibe about ansi standards and MS not following them is a bit cheap, in
> SQL Server you can use the ansi standard if you want - well, a lot of the 92
> implementation anyway.
>
> I'm not familiar with vfp - does it follow the ansi standard - the syntax
> you posted doesn't look familiar.
>
> --
> Tony Rogerson, SQL Server MVPhttp://sqlblogcasts.com/blogs/tonyrogerson
> [Ramblings from the field from a SQL consultant]http://sqlserverfaq.com
> [UK SQL User Community]
Hi Tony,
VFP supports multiple standards including their own sql standards.
There is an engine behavior flag that governs which variation FoxPro
Uses.
If you are interested here is a link to another forum about it...
http://fox.wikis.com/wc.dll?Wiki~Enginebehavior~VFP
The syntax I ended up using was a variant of this, with part of it
wrapped in a CTE for readability.
Just seemed like a lot of code for such a simple task ... Moveover my
last post was incorrect it should
not have said duplicate records.
SELECT I1.invoice_nbr, C.customer_name, C.shopping_addr, C.acct_nbr
FROM Invoices AS I1,
Customers AS C
WHERE I1.acct_nbr = C.acct_nbr
AND I1.posting_date
= (SELECT MAX(I2.posting_date)
FROM Invoices AS I2
WHERE I2.acct_nbr = C.acct_nbr);
I only been coding in sql server 2005 for about 6 month... I been
using foxbase then vfp forever however with it's end of life all new
projects are in sql
and there just seems to be ALOT more coding involved to accomplish the
same task, especially when doing anything on a row by row level ....
SQL also lacks a built in debugger going into .NET is a pain . . .
But what can you do :) ....
I will try your suggestion and thanks everyone for the help...
Bryan
[Back to original message]
|