RE: [NF] SQL question

Author: Anthony Testi

Posted: 2004-05-24 at 13:16:07

AJ,

is it possible to Normalize this data. ( I am being to think that my first

answer to any SQL problem is to just say have you normalized the data, even

if there is no connection. <w> )

e.g. I see that there are repeating columns if you could pull that out and

create a subtable called something like Bill_Payment_Dates:

BPD_ID

Who_Paid ( Maybe a FK to a 'Who' table ? )

When_Paid

Now the SQL statement could use an order by date DESC to find the last date.

In your case a MAX( Field1, Field2.. ) may be helpful, but a second pass

would have to be done ( I think ) to find the column name.

Anthony ( Not a SQL expert <s> )

> -----Original Message-----

> From: aj [mailto:aj@medicaldirector.com]

> Sent: Monday, May 24, 2004 9:50 AM

> To: profoxtech@leafe.com

> Subject: [NF] SQL question

>

>

> I am using foxpro but its a SQL question anyway.

>

> Ive googled my a$$ off on the topic but cant seem to find an answer.

> I have a table with a few date columns for payment dates. I

> need to get

> the highest value out of this table and display it as a

> single column in

> my query. On top of that, each date row determines who paid

> the bill.

> An attorney a doctor etc. and mark the returned data as such ex

> "10/24/05 ATT".

> Anyone been down this road before.

>

>

>

>

[excessive quoting removed by server]

©2004 Anthony Testi