Access Convert Date Serial Number

 admin  
Access
  1. Excel Convert Date To Serial

Excel Convert Date To Serial

Working with Dates in Access Queries Access has a number of powerful tools to enable specific dates and date ranges to be specified in criteria. Many tasks can be achieved with simple calculations, and there are a number of date functions to help in performing more complex jobs.

ConvertAccess convert time to number
ExpertMod15k+
It only works in Excel because you haven't tested it properly. Strings don't change when put through any Formatting. Excel converted them to dates (or numbers depending on your test procedure) as soon as you entered them in.
As ADezii says, CDate() is what you need to convert a string in date format into a date. Dates are stored as numbers anyway, so how you use that is down to you (in your code).
I would say at this point, that you should probably reconsider your use of text fields to store your dates. I'm frequently instructing people that dates should only ever be converted from dates into strings at the very last point. IE. When displaying for a human. Up until that point they can have formats assocated with them, but should be stored in numeric form. I don't know your exact situation, so it's hard for me to be categorical about it, but I can say that trying to work with dates that aren't stored as dates is like trying to work with one hand tied behind your back. Converting values backwards and forwards as you go is simply poor coding practice and should be avoided where possible (Anyone with any experience looking at such code will be immediately unimpressed).
   Coments are closed