473,418 Members | 2,084 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,418 software developers and data experts.

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 2790
Savvas Tsitouridis wrote on 03 jul 2007 in
microsoft.public.inetserver.asp.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("dateField") 'or whatever your field is named
response.write myFormDate(myDate)

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.public.inetserver.asp.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
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...
2
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...
6
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
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
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
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...
3
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...
3
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...
3
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...
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
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
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...
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
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...
0
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...

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.