datetime

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Neumann

    #1

    datetime

    Hi There,

    is there any possibility to declare datetime-column with special format in
    ALTER TABLE-Statement.

    e.g. I run the following query in MS-Access:

    ALTER TABLE table ADD Datum DATETIME;

    I get an add. column with datetime but NO "Format". I need to have "short"
    format (xx.xx.xxxx),
    but I cannot see any chance to alter my SQL-Query in order to get this
    working. The problem is,
    that I cannot use any of the access-tools to declare this column "short
    format" 'cause I can only
    use standard sql-queries to add this column.

    Hope you can help!

    ON


  • Rick Brandt

    #2
    Re: datetime

    "Oliver Neumann" <oliver.neumann @newidentity.de > wrote in message
    news:bmm3lc$onp uh$1@ID-130774.news.uni-berlin.de...[color=blue]
    > Hi There,
    >
    > is there any possibility to declare datetime-column with special format[/color]
    in[color=blue]
    > ALTER TABLE-Statement.
    >
    > e.g. I run the following query in MS-Access:
    >
    > ALTER TABLE table ADD Datum DATETIME;
    >
    > I get an add. column with datetime but NO "Format". I need to have[/color]
    "short"[color=blue]
    > format (xx.xx.xxxx),
    > but I cannot see any chance to alter my SQL-Query in order to get this
    > working. The problem is,
    > that I cannot use any of the access-tools to declare this column "short
    > format" 'cause I can only
    > use standard sql-queries to add this column.[/color]

    I can't think of any circumstance where the format property of the table
    should make one whit of difference. You are aware that this has zero
    affect on how the date is stored, correct? Since users should never be
    exposed to the tables directly, you only need to worry about the format in
    forms and reports.


    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com


    Comment

    • Oliver Neumann

      #3
      Re: datetime

      "Rick Brandt" <rickbrandt2@ho tmail.com> schrieb im Newsbeitrag
      news:bmm5o7$o7m on$1@ID-98015.news.uni-berlin.de...[color=blue]
      > "Oliver Neumann" <oliver.neumann @newidentity.de > wrote in message
      > news:bmm3lc$onp uh$1@ID-130774.news.uni-berlin.de...[color=green]
      > > Hi There,
      > >
      > > is there any possibility to declare datetime-column with special format[/color]
      > in[color=green]
      > > ALTER TABLE-Statement.
      > >
      > > e.g. I run the following query in MS-Access:
      > >
      > > ALTER TABLE table ADD Datum DATETIME;
      > >
      > > I get an add. column with datetime but NO "Format". I need to have[/color]
      > "short"[color=green]
      > > format (xx.xx.xxxx),
      > > but I cannot see any chance to alter my SQL-Query in order to get this
      > > working. The problem is,
      > > that I cannot use any of the access-tools to declare this column "short
      > > format" 'cause I can only
      > > use standard sql-queries to add this column.[/color]
      >
      > I can't think of any circumstance where the format property of the table
      > should make one whit of difference. You are aware that this has zero
      > affect on how the date is stored, correct? Since users should never be
      > exposed to the tables directly, you only need to worry about the format in
      > forms and reports.[/color]

      Ahhh, ok. Thought it would make difference on how data is stored.

      Thanks.

      ON


      Comment

      • Fletcher Arnold

        #4
        Re: datetime

        "Oliver Neumann" <oliver.neumann @newidentity.de > wrote in message
        news:bmm3lc$onp uh$1@ID-130774.news.uni-berlin.de...[color=blue]
        > Hi There,
        >
        > is there any possibility to declare datetime-column with special format in
        > ALTER TABLE-Statement.
        >
        > e.g. I run the following query in MS-Access:
        >
        > ALTER TABLE table ADD Datum DATETIME;
        >
        > I get an add. column with datetime but NO "Format". I need to have "short"
        > format (xx.xx.xxxx),
        > but I cannot see any chance to alter my SQL-Query in order to get this
        > working. The problem is,
        > that I cannot use any of the access-tools to declare this column "short
        > format" 'cause I can only
        > use standard sql-queries to add this column.
        >
        > Hope you can help!
        >
        > ON[/color]

        As Rick has pointed out, there isn't much point to adding the format
        property - and this is why it isn't supported with the ALTER TABLE column.
        However, if you really had to do this - for example, a customer looked at
        the tables using Access, but couldn't work out how to do this on his own,
        then I suppose you could write a small patch in vbs. Note you would have to
        use DAO to get there.

        Fletcher

        Set eng = CreateObject("D AO.DBEngine.36" )
        Set dbs = eng.OpenDatabas e("C:\Test\db1. mdb", True)
        Set tdf = dbs.TableDefs(" MyTable")
        Set fld = tdf.CreateField ("NewDateField" , 8)
        tdf.Fields.Appe nd fld
        Set prp = fld.CreatePrope rty("Format", 10, "ddd dd-mmm-yy")
        fld.Properties. Append prp
        Set prp = Nothing
        Set fld = Nothing
        Set tdf = Nothing
        dbs.Close
        Set dbs = Nothing
        Set eng = Nothing
        Msgbox "Done", vbInformation


        Comment

        Working...