473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
Nov 12 '05 #1
3 10241
"Oliver Neumann" <ol************@newidentity.de> wrote in message
news:bm************@ID-130774.news.uni-berlin.de...
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.


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
Nov 12 '05 #2
"Rick Brandt" <ri*********@hotmail.com> schrieb im Newsbeitrag
news:bm************@ID-98015.news.uni-berlin.de...
"Oliver Neumann" <ol************@newidentity.de> wrote in message
news:bm************@ID-130774.news.uni-berlin.de...
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.


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.


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

Thanks.

ON
Nov 12 '05 #3
"Oliver Neumann" <ol************@newidentity.de> wrote in message
news:bm************@ID-130774.news.uni-berlin.de...
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


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("DAO.DBEngine.36")
Set dbs = eng.OpenDatabase("C:\Test\db1.mdb", True)
Set tdf = dbs.TableDefs("MyTable")
Set fld = tdf.CreateField("NewDateField", 8)
tdf.Fields.Append fld
Set prp = fld.CreateProperty("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
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Max M | last post by:
# -*- coding: latin-1 -*- """ I am currently using the datetime package, but I find that the design is oddly asymmetric. I would like to know why. Or perhaps I have misunderstood how it...
16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
15
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" ...
3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
6
by: Ante Perkovic | last post by:
Hi, How to declare datetime object and set it to my birthday, first or last day of this month or any other date. I can't find any examples in VS.NET help! BTW, what is the difference...
5
by: I am Sam | last post by:
I have created this DateTime object and instanced it I think correctly DateTime myClubNow1=new...
26
by: Reny J Joseph Thuthikattu | last post by:
Hi, I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a miniute to it.How can i do that? by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004 12:00 AM'...
11
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
9
by: Phil B | last post by:
I am having a problem with a datetime from a web services provider The provider is sending the following SOAP response <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.