Text to Date field in Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rhonda6373
    New Member
    • Mar 2010
    • 35

    #1

    Text to Date field in Access

    I am trying to subtract 2 dates in Access, however they are currently in text fields and I cannot subtract. Is there any way to change them to a date field?
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    So are you trying to find out how many days are between those two dates? If so, then you would use the DateDiff() function. You would then have an unbound textbox that uses this as it default value. Here is more information about the DateDiff() function: Calculate the difference between two date or time values
    If you are looking to add a certain about of time to a date, then you would use the DateAdd() function. MS Access: DateAdd Function

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      rhonda6373:
      You have not provided enough information.
      Where are the fields located?
      What format is the date in?
      Where are you trying to do the calculation?
      -z

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Yes Rhonda. The CDate() function will do that for you.

        Comment

        Working...