473,396 Members | 1,833 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,396 software developers and data experts.

M$ CREATE TABLE DATE Issue

I am writing some Visual basic code that needs to create a M$ Access DB
with a table that has a DATE ROW with dd/mm/yyyy in the Format as you
would see in the general tab of the table-view.

e.g sql = "CREATE TABLE DailyTbale ([R_Date] DATE(dd/mm/yyyy)"

That type of thing. ??
Any Takers ??
Jul 3 '06 #1
2 1739
Greg, you cannot set the Format of the date field in a DDL query statement.
For that, you must use DAO (or set the format manually.)

However, if you have your Regional Settings set correctly in the Windows
Control Panel, Access will use that date format in your interface, without
needing to set the Format property of the field.

Of couse, literal values in VBA code or SQL statements still need to be in
the native JET format of mm/dd/yyyy.

More info:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html
That's my experience with using Access in Australia for 13 years.

Post a reply if you want more info on how to programmatically
CreateProperty() on the Field in the TableDef, so as to define a specfic
format.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Greg McLennan" <we******@iinet.net.auwrote in message
news:44**********************@per-qv1-newsreader-01.iinet.net.au...
>I am writing some Visual basic code that needs to create a M$ Access DB
with a table that has a DATE ROW with dd/mm/yyyy in the Format as you would
see in the general tab of the table-view.

e.g sql = "CREATE TABLE DailyTbale ([R_Date] DATE(dd/mm/yyyy)"

That type of thing. ??
Any Takers ??

Jul 3 '06 #2
Allen Browne wrote:
Greg, you cannot set the Format of the date field in a DDL query statement.
For that, you must use DAO (or set the format manually.)

However, if you have your Regional Settings set correctly in the Windows
Control Panel, Access will use that date format in your interface, without
needing to set the Format property of the field.

Of couse, literal values in VBA code or SQL statements still need to be in
the native JET format of mm/dd/yyyy.

More info:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html
That's my experience with using Access in Australia for 13 years.

Post a reply if you want more info on how to programmatically
CreateProperty() on the Field in the TableDef, so as to define a specfic
format.
Thanks for the info. I will look into it today further
Jul 3 '06 #3

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

Similar topics

2
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and...
8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
2
by: Alicia | last post by:
Does anyone know why I am getting a "Syntax error in Create Table statement". I am using Microsoft Access SQL View to enter it. Any other problems I may run into? CREATE TABLE weeks (...
24
by: flkeyman | last post by:
Work in legal office. Trying to create solid designed database structure. This is list of tables w/fields and primary keys. Any comments/advice greatly appreciated. tbl-Defendants CaseNumber...
12
by: GCM | last post by:
Hi, I have a table that has the following fields; LName, FName and MName. Also there are other fields in the table. I need to create another table with those fields combined as "Trim( & " " & &...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
7
by: Lucas_london via AccessMonster.com | last post by:
Hi I have set up a database/tables in Access based on daily timeseries data. However I would like to create two additional columns in the table as a basis to pull the data on a weekly and...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.