Filtering for Numbers without Zeros
I have a query in access that is pulling a rating number from a table. I want to pick the most recent number in the query without a zero in it. It's also by dates. Dates and Rating are two seperate columns.
Some examples.
Date | Rating
10/01/2007 | 0010/0
6/13/2005 | 1002/0
4/23/2003 | 2312/2 <- I only want numbers without zeros appearing
If that isn't possible, how can I filter out the last number that is a zero.
So if its /1, /2, /3 etc it finds it but doesn't if it is /0.
Any help would be great. Sorry if it might be confusing to understand.
Thanks,
-Chris
Re: Filtering for Numbers without Zeros
To get the most recent, sort the records in descending order and use the Top clause. Use Like to check if the Rating contains a 0
Code:
SELECT Top 1 [Date], Rating
FROM Ratings
Where Rating Not Like '*0*'
Order By [Date] Desc;
Re: Filtering for Numbers without Zeros
Thank you for your post brucevde,
Although it does work for the most part, it unfortunately didn't do what I needed it too. So instead I have written a routine to do the filtering, which came out quite nicely, just more work involved then I wanted. :rolleyes:
Thanks again for your reply.
~Chris