Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show latest value, except future dates

Status
Not open for further replies.

BregjeE

Programmer
Nov 19, 2001
5
DE
I need to retreive only the latest purchase price from my database for which the date is today or in the past. I've used the solution of GKar (July, 24th; using calculation in the condition). For most of the records it works fine, but in my database are also a few values with a date in the future, like this:

entry date purchase price
1/1/2001 0.00
31/12/2001 784.00

In this case GKar's solution returns the value 784.00 in stead of 0.00.
I've tried to create a second condition for the date, to make sure that it returns values less than or equal to today, but this gives an SQL error. I've also tried to modify the universe the force it, but it returns the same error.

Does anyone know a solution for this problem?

tia, Bregje
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top