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. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 18 Times in 18 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".

  3. #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?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 18 Times in 18 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
  •