473,893 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date filed in Access Database

Hello

I have an Access database with a date field
The format that we store values is dd/mm/yyyy (greek)
The problem is that i can't retreive the correct dates because the queries
return only the english format dates.
How to format the query to english date format (mm/dd/yyyy)?

Thank you
Jul 3 '07 #1
3 2816
Savvas Tsitouridis wrote on 03 jul 2007 in
microsoft.publi c.inetserver.as p.general:
I have an Access database with a date field
The format that we store values is dd/mm/yyyy (greek)
NOT true, a date field is filled with an access internal numeric
representation of the date/time, so unformatted, and even comes out
unformatted.

I suppose you access that database using the jet engine under ASP-
vbscript?
The problem is that i can't retreive the correct dates because the
queries return only the english format dates.
[You perhaps mean the American one, mm/dd/yyyy, English is like yoursx
and ours]

No they do not, they are converted to the numeric representation of the
computer language you use [vbscript?]

Only if you use [the lazy way]

response.write myDate

there is an automatic conversion to the format
your own server's reginal settings provides.

Try:

<% ' vbscript

myDate = mDATA("dateFiel d") 'or whatever your field is named
response.write myFormDate(myDa te)

function myFormDate(x)
myFormDate = two(day(x)) & "/" & two(month(x)) & "/" & year(x)
end function

function two(x)
two = right("0" & x,2)
end function

%>
How to format the query to english date format (mm/dd/yyyy)?
See above.
A query does not format!
"to English"?, I do not think that is what you ment.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 3 '07 #2
Evertjan. wrote:
>How to format the query to english date format (mm/dd/yyyy)?

See above.
A query does not format!
Well, technically it can, via the same means your vbscript example uses:
convert the date to a string. Of course, if date arithmetic or comparisons
need to be done, the string representaion of the date needs to be converted
back to a date.

select Right("0" & Month([datefield]),2) & "/" & ...
(the rest is left as an exercise for the reader)
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 3 '07 #3
Bob Barrows [MVP] wrote on 03 jul 2007 in
microsoft.publi c.inetserver.as p.general:
Evertjan. wrote:
>>How to format the query to english date format (mm/dd/yyyy)?

See above.
A query does not format!

Well, technically it can, via the same means your vbscript example
uses: convert the date to a string. Of course, if date arithmetic or
comparisons need to be done, the string representaion of the date
needs to be converted back to a date.

select Right("0" & Month([datefield]),2) & "/" & ...
(the rest is left as an exercise for the reader)
You are right, as usual, I stand corrected.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 3 '07 #4

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

Similar topics

0
1422
by: Luis Esteban Valencia | last post by:
Hi, I am using windows 2000 Pro with SP4 for development and database is access2000. Regional Setting is as follows: Regional Options: Your locale(location): English United States short date format: M/d/yyyy long date: dddd, MMMM dd, yyyy
2
4559
by: devprog | last post by:
objConn = New ADODB.Connection objConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath _ & ";Jet OLEDB:Database Password=" & dbPassword) This cause error: (VB.NET. ) sqlString = "insert into table1 " _ & "(Date1,Time,Ext,Co) values " _ & "('04/04/05','06:02PM','101','01');"
6
4446
by: yoshitha | last post by:
hi db : sql server 2000 lan : C#.net(ASp.Net) in my database table there are 2 fileds of data type datatime. in field 1 i'm storing date in field 2 i'm storing time.
3
8809
by: John | last post by:
Hi How can I ensure that date is always assigned in dd/mm/yyyy format to a date filed, in an update query? Thanks Regards
3
1224
by: umeshkakade | last post by:
i have 4 fields in access database : rollno, name, date, fees i am writing code in vb. i want to find rollno, name & date through vb (simultaneously) & i want to display respective fees.
3
1255
by: khalid sohail | last post by:
HI every one can anyone help me in matching the date that user enter in the text field and to that which is stored in the database. i have the textbox where i take the input from the user and then i match that date with the date that is stored in the database table. i have the database in MS ACCESS and the filed datatype is date.time. hope i have explained my problem well.................. ................Thanx in...
3
6298
by: Finn Stampe Mikkelsen | last post by:
Hi I have defined a table in my database, with 2 date-fields. I have set a default value to DBNull. I have integrated a nullable datetimepicker control to my project and set the apropriate NullValue in my datagridview... Everything works great, with a table-row added manually to the database, without setting any value to the second date-field. Both the datagridview and the datetimepicker displays correctly the DBNull value..
3
1253
by: Jackiegall | last post by:
Hi. I have only limited knowledge of Access 2007, as the database I use was created by a former employee - I just use it & have no idea how it works! There are approx 600 customer records in the database, and each customer has anything from 5 to 150 or more order. My problem is that recently, new orders are suddenly being filed in the wrong order instead of most recent order first. So I have orders dated August 08 filed say in amongst orders...
3
2923
by: shawnmiller77 | last post by:
Need Help ASAP! History: Installed new SBS 2003 server on Monday. Migrated IIS, website and current Access database over to new server. I did not develop the website or Access database. Former IT guy is no where to be found. Everything is working on the new server except for one .asp page in the website that ties to the Access database. When I try and input data on the page and save it I receive the follwoing error: Microsoft OLE DB...
0
9830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11243
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10837
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10927
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10469
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7173
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4684
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3289
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.