Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Data Type Formatting Issue (XP)

    I am trying to find a function to format a "Date/Time" data type as a "text" data type in a query. Does anyone know how to do this?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Data Type Formatting Issue (XP)

    You can use the CStr or Format function for this.

    CStr([DateField]) and Format([DateField]) will return the value of DateField using the Short Date format of your system.

    Format lets you specify a different format: Format([DateField], "dddd d mmmm yyyy") will return the value of DateField in a format like "Friday 23 May 2007".

  4. #3
    New Lounger
    Join Date
    Jan 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Data Type Formatting Issue (XP)

    Thanks for the update!

    But, we are trying to change a "Date/Time" field into a "text" or "String" field. Is there a way to achieve this through a function?

  5. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Data Type Formatting Issue (XP)

    If you want to change the data type of a field in a table, open the table in design view and change it there.

    If you want to return a string value in a query, see my previous reply.

    If you want something else, please explain.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •