471,832 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,832 software developers and data experts.

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 1368
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 YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.