469,313 Members | 2,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,313 developers. It's quick & easy.

how to retrive the data using asp

Dear all
iam new for ASP

I have data in database as like as follows

Name company shares date
A x 100 1/1/07
A x 200 5/1/07
A y 100 2/1/07
A y 500 5/1/07


I need to display as follows

Name company shares date
A x 200 5/1/07
A y 500 5/1/07

U can notice the latest updating for each name for all companies
This is the output I should show in my web page
Jan 23 '07 #1
1 1333
jhardman
3,406 Expert 2GB

I need to display as follows

Name company shares date
A x 200 5/1/07
A y 500 5/1/07

U can notice the latest updating for each name for all companies
This is the output I should show in my web page
so... your database potentially has multiple entries for each company, and you only want to display the most recent?

I would sort the data by company, then date in reverse, then only display the first (most recent) entry for each company.

query :
"SELECT Name, company, shares, date FROM companyTable ORDER BY company, date DESC"

Hmm. Syntax doesn't look quite right. I'll look it up if you want.

Anyway, after you pull up one entry, skip ahead until you get to the next company, pull up one entry, skip ahead, etc.
Jan 31 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by =?Utf-8?B?UGV0ZXIgSiwgU2Nhbmlh?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.