Darren Smith
Well-known Member
- Joined
- Nov 23, 2020
- Messages
- 631
- Office Version
- 2019
- Platform
- Windows
When I ascend the date order in the field it loses lots of rows of data does anyone know why this is?
SELECT Table1.Todaydate, Table1.Tim1
FROM Table1
WHERE (((([Table1].[Todaydate])=Year([TodayDate]))=Year(Now())) AND ((Month([TodayDate]))=Month(Now())));
WHERE (Right([Table1].[Todaydate],7) = Format(Date(),"mm/yyyy"))
Good point. I lost site of the original question.It's text, so 13 comes before 9? It should be a date field, not a text field.
MySort: RIGHT("0" & [Table1].[Todaydate],8)
The original replies by etaf were Excel-related (he did not realize this was posted in the Access forum and not the Excel one), so they were deleted.I'd just make the field a date data type and all of the problems should go away without a lot of work. Perhaps that is not an option.
As for 'disappearing' data, I figured that there are probably fields with nulls (which will sort first) or empty strings (in which case I don't know the effect of sorting), and what is being characterized as an issue really isn't. I have never seen sorting "lose" records.
So it doesn't sound like changing the data type is an option.The thing is I am taking the Data linked to another Access Database which I cannot alter.