I have some VBA code that (essentially) takes a user input for a date, and uses that date in an update query SQL.
However the problem I'm having is that my date is in local UK format, but when SQL runs it converts it to US format e.g. 5th Jan 2017 is inputted and stored as 05/01/2017 as Date type ("DD/MM/YYYY"), but when using that in DoCmd.RunSQL update query it will interpret it as 1st May 2017 (01/05/2017).
I want to convert my date to its serial number to avoid this problem e.g. 42740 above and then use this in my SQL update query, which works fine.
However I'm stuck as to how to actually convert it to a serial purely within VBA environment. I'm sure it's simple and that I'm just drawing a blank... apologies if so.
Any ideas?
However the problem I'm having is that my date is in local UK format, but when SQL runs it converts it to US format e.g. 5th Jan 2017 is inputted and stored as 05/01/2017 as Date type ("DD/MM/YYYY"), but when using that in DoCmd.RunSQL update query it will interpret it as 1st May 2017 (01/05/2017).
I want to convert my date to its serial number to avoid this problem e.g. 42740 above and then use this in my SQL update query, which works fine.
However I'm stuck as to how to actually convert it to a serial purely within VBA environment. I'm sure it's simple and that I'm just drawing a blank... apologies if so.
Any ideas?