Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    phoenix, az
    Posts
    1

    Unanswered: formatting Date/Time datatype in table using CREATE TABLE

    I'm using ColdFusion to creating a table in Access on the fly. One of my columns in the Access table is a Date/Time datatype. In SQL, using the CREATE TABLE command, how can I format the Date/Time column to appear in Access as a 'Short Date,' i.e., 12/15/03?

    Any suggestions would be helpful. Thanks!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    The type you use is DATETIME

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i don't think you can define that via DDL

    HOWTO: Common DDL SQL for the Microsoft Access Database Engine

    a datetime column is a datetime column, whereas "short date" is just a display format

    if you want a specific format returned to coldfusion, i would suggest that you use the access FORMAT() function to produce a string exactly the way you want it

    select FORMAT(thedate,"mm/dd/yy") as shortdatestring

    either that, or select the datetime field as a datetime field, and then use the coldfusion DateFormat function to format it

    #DateFormat(thedate,"mm/dd/yy")#
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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