I'm so sorry but, I just can't seem to get an understanding of what you are
stating.
I put the Top 1 in the sql view and I got a order by error.
I didn't think this post went threw so I tried rephrasing the question.
This is what I tried that seems to work however, it does not give me the
last day of the month it gives me the next to the last day of the month.
I used this for your FIELD in the query grid --
X: DatePart("yyyy",[YourDateField])&DatePart("m",[YourDateField])
I used this as the Criteria in the query grid --
DatePart("yyyy",Date()-Day(Date()))&DatePart("m",Date()-Day(Date()))
--
Thanks
D''''Angelia
Ofer said:
Sorry, but I answered your next post again, I didn't notice it was you.
When you run a query, and you sort it by DateField Desc, it will display
that last enetered record on the Top of the query, and under it the rest of
the records by order
When you add the Top 1, the query will return only one record the the top one
Select Top 1 TableName.* From TableName Order By dateField Desc
==============================================
So just create a query that return all the records, with the recent one on
top, and then add to the sql Top 1
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
:
I'm not sure what you mean by Select Top 1 TableName Order By ContrDate Desc
Sorry
--
Thanks
D''''Angelia
:
Instead of using Last for each record, use the Top 1, with sort on the field
that indicate which field was the last one to be insert, like a date or a
number
Select Top 1 TableName Order By ContrDate Desc
You can change the Top number to recieve more then one record
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
:
Hello,
I'm trying to get the last record by using last in the sum/total row in a
query.
I'm using 'Last' on all four of the four fields listed below. I sometimes
get the correct result until I close MS Access and return in hours the result
is completely different.
ContrDate
Activity
HoursSpent
AmtPaid