David Ball
Registered User.
- Local time
- Today, 20:21
- Joined
- Aug 9, 2010
- Messages
- 230
Hi,
I have a query that is based on a table that is updated from a spreadsheet that I get from another department. There is a Date column in the spreadsheet for Forecast Delivery Dates. Unfortunately, when an item has arrived they enter “Delivered” instead of the date. So I have a column that has dates and text and I need to be able to sort by the dates to arrange them with the latest delivery dates at the top (I don’t care about the items already delivered).
I created a field that converts the “Delivered” text to a date in the past (say, 01-Jan-12). This looks OK but the dates don’t sort properly.
I added another field that uses the FORMAT function to format as “Medium Date”. Again, it looks OK but dates don’t sort properly because they look like dates but are a string.
I then created another field that uses CDate to convert to a date. When I go to Sort this I get a message “Data Type Mismatch in Criteria Expression”.
What do I need to do to be able to Sort these dates?
Is there a way that I can Sort the original field, containing both dates and text, by date?
Thanks very much.
Dave
I have a query that is based on a table that is updated from a spreadsheet that I get from another department. There is a Date column in the spreadsheet for Forecast Delivery Dates. Unfortunately, when an item has arrived they enter “Delivered” instead of the date. So I have a column that has dates and text and I need to be able to sort by the dates to arrange them with the latest delivery dates at the top (I don’t care about the items already delivered).
I created a field that converts the “Delivered” text to a date in the past (say, 01-Jan-12). This looks OK but the dates don’t sort properly.
I added another field that uses the FORMAT function to format as “Medium Date”. Again, it looks OK but dates don’t sort properly because they look like dates but are a string.
I then created another field that uses CDate to convert to a date. When I go to Sort this I get a message “Data Type Mismatch in Criteria Expression”.
What do I need to do to be able to Sort these dates?
Is there a way that I can Sort the original field, containing both dates and text, by date?
Thanks very much.
Dave