I have a table as below
product char(10)
date datetime
points integer(9)
flag char(1)
my requirement is to show the last (by date) 10 points (with dates) on one line, for all products
example
product points date points date points date (for 10)
product2 points date...
Alex / Zathras, now I pretty much have this sql performing how I want it, I am attempting another one.
Same Table as above;
product char(10)
date datetime
points integer(9)
flag char(1)
but the requirement is now to show the last (by date) 10 points (with dates) on one...
I must have cocked up somewhere.
I'm reading into a dataset then into a datagrid, and have somehow changed something thats forcing the datetime into a date format. Its a stored procedure I'm running, which when I run the sql from in a sql session works fine, but is not in the application...
Alex,
Thanks, this works well. I am running on SQL Server, and calling through a C# windows application.
Interestingly, when I run this in a sql query screen and select * then I get the field date passed back as datetime (which it is), but when run as a script the select * returns the...
Zathra, struggling to get yours going, I have many records in one day (differing times), and I think yours is presuming one record per day.
AlexCuse, yours is fine except it only flags the latest record, not both.
I will play with both, and then decide which to use.
Thanks again for...
Hi,
I have a table;
product char(10)
date datetime
points integer(9)
flag char(1)
I want to read the latest (by date) 2 records for each product and add a flag to each if the points value has changed.
To be honest I don't have much sql and am completely stuck
Thanks for...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.