David Ball
Registered User.
- Local time
- Tomorrow, 09:18
- Joined
- Aug 9, 2010
- Messages
- 230
Hi,
I have a listbox on a form populated by the following code behind a control button:
SELECT DISTINCT [tblSMSdata].[Reporting Week Ending] FROM tblSMSdata UNION SELECT "ALL" FROM tblSMSdata
The dates in the table are in the format dd-mmm-yyyy (25-Apr-2016) but in my Listbox the dates appear like 25/04/2016. When I try to run the code I get a message “Data type mismatch in criteria expression”. I am assuming this is because the dates are in different formats. How can I have the dates in the listbox the same as the dates in the table?
Also, the dates in the listbox are not sorted in chronological order. Am I able to have the dates in ascending order in my listbox?
Thanks very much
Dave
I have a listbox on a form populated by the following code behind a control button:
SELECT DISTINCT [tblSMSdata].[Reporting Week Ending] FROM tblSMSdata UNION SELECT "ALL" FROM tblSMSdata
The dates in the table are in the format dd-mmm-yyyy (25-Apr-2016) but in my Listbox the dates appear like 25/04/2016. When I try to run the code I get a message “Data type mismatch in criteria expression”. I am assuming this is because the dates are in different formats. How can I have the dates in the listbox the same as the dates in the table?
Also, the dates in the listbox are not sorted in chronological order. Am I able to have the dates in ascending order in my listbox?
Thanks very much
Dave